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
Shelljs print stderr to console even if exec-only "silent" is true #905
Comments
Already fixed in the master, not in npm. |
Yup, this is handled. I'll cut a release soon. |
@solominsn Thanks a lot for fixing this issue! |
Is there an option on master to keep the current behavior of printing the output only on error? |
No such option, unfortunately. If you want this behavior only for const ret = shell.exec(cmd, { silent: true });
process.stdout.write(ret.stdout);
// or
const c = shell.exec(cmd, { silent: true, async: true });
c.stdout.on('data', data => {
process.stdout.write(data);
}); Edit: accidentally clicked "submit" before I was finished typing. Apologies. |
Re-closing (I think I reopened accidentally, sorry). Filed the request as #927 |
For tracking, this is a duplicate of #851 |
Node version (or tell us if you're using electron or some other framework):
6.14.x, but it doesn't matter
ShellJS version (the most recent version/Github branch you see the bug on):
0.8.2
Operating system:
Debian 10
Description of the bug:
Bug #887 has been closed, but it's a real bug. Exec-only "silent" option is not passed to helper function (common.error) which check error code and write stderr to console. Changing global config "silent" to false is only way to suppress stderr printing. If required fix can be prepared and pushed.
Example ShellJS command to reproduce the error:
Invalid command returns non-zero error code and shelljs print stderr to console.
The text was updated successfully, but these errors were encountered: