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

Exec issues with string option introduced in 0.7.4 #515

Closed
shaunwarman opened this issue Sep 2, 2016 · 2 comments
Closed

Exec issues with string option introduced in 0.7.4 #515

shaunwarman opened this issue Sep 2, 2016 · 2 comments

Comments

@shaunwarman
Copy link

Node version (or tell us if you're using electron or some other framework):

4.5.0

ShellJS version (the most recent version/Github branch you see the bug on):

0.7.4

Operating system:

OS X

Description of the bug:

Oddly, 0.7.4 throws internal error when using String options in exec call. For some reason this was working in previous versions, but recent change in 0.7.4 alters the behavior to accept a string option. After changing to the expected signature of object it works as it should. But it's interesting to know why this worked as a string in previous versions? Did a commit from March sneak in to 0.7.4 that altered exec functionality? Or am I missing something in recent commits?

Example ShellJS command to reproduce the error:

var shelljs = require('shelljs');
shelljs.exec('hostname -f', 'silent');
@nfischer
Copy link
Member

nfischer commented Sep 4, 2016

The following API has never been (to my knowledge) supported:

shell.exec(cmd, 'silent');

If that ever worked, it was by pure luck.

We only aim to support this:

shell.exec(cmd, { silent: true });

Are you saying that the unsupported API used to work, but is now broken? Or that the supported API no longer works in the recent version?

Also, what version are you comparing against? Is this a chance between 0.7.3 -> 0.7.4, or 0.6.x -> 0.7.x?

@shaunwarman
Copy link
Author

0.7.3 -> 0.7.4.. oddly the string signature worked (even though it shouldn't have) and a change in 0.7.4 fixed that.

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

No branches or pull requests

2 participants