Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--set command doesn't work when only passing one of them #40

Open
davehibshman opened this issue Feb 12, 2016 · 2 comments · May be fixed by #43 or #44
Open

--set command doesn't work when only passing one of them #40

davehibshman opened this issue Feb 12, 2016 · 2 comments · May be fixed by #43 or #44

Comments

@davehibshman
Copy link

  1. Passing a single --set option: winser -i -s --set "Application C:\path\of\some\kind.exe" returns with error message: Set operation failed (e)

  2. Passing multiple set options: winser -i -s --set "Application C:\path\of\some\kind.exe" --set "AppParameters start" works fine.

Watching typeof options.set in the debugger in both circumstances it appears when passing a single --set argument options.set type is 'string', however when passing more than one it is of type 'object', specifically upon further inspection, it is an array as expected.

Line #313 in the current file async.each(options.set, appears to expect an array in all cases and thus fails for the first case listed above.

I am not sure if this is how stdio.getopts is intended to work or not, but I think it's a bug here none the less. I'll submit a pull request if author doesn't address this. There may be other areas of the code where this is a problem, probably any args marked as expecting mutiple.

Note if you need the current code to work with one -set argument you can pass a second --set option that is just a single space, or anything really, except nothing or empty string. You will get an error message stating 'Set operation failed ( )' for the second arg if it isn't a valid arg, but the first one will work as expected.

Windows 8.1 Enterprise
node v0.12.0
npm v2.5.1
winser v^1.0.2

@kanreisa
Copy link

kanreisa commented Apr 9, 2016

👍

@Codesleuth Codesleuth linked a pull request Sep 2, 2016 that will close this issue
@Codesleuth
Copy link

We've opened a pull request with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants