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

spawned process stdio options not passed properly #33

Closed
maxlath opened this issue Nov 10, 2016 · 1 comment · Fixed by #34
Closed

spawned process stdio options not passed properly #33

maxlath opened this issue Nov 10, 2016 · 1 comment · Fixed by #34

Comments

@maxlath
Copy link
Contributor

maxlath commented Nov 10, 2016

At git-hooks.js#L188, args may be undefined, thus spawn considers that no option object is passed, ignoring {stdio: 'inherit'}: that would explain why scripts logs disappear.

Making a PR to solve this issue.

maxlath added a commit to maxlath/git-hooks-js that referenced this issue Nov 10, 2016
@maxlath maxlath changed the title spawned process stdio option not passed properly spawned process stdio options not passed properly Nov 10, 2016
@maxlath
Copy link
Contributor Author

maxlath commented Nov 10, 2016

To reproduce spawn behavior:

var spawn = require('child_process').spawn;
var args = [];
// logs the output of pwd
spawn('pwd', args, {stdio: 'inherit'});
var spawn = require('child_process').spawn;
var args;
// stay silent
spawn('pwd', args, {stdio: 'inherit'});

tarmolov pushed a commit that referenced this issue Nov 11, 2016
* Avoid to pass an undefined args argument to spawn as it makes the option object being ignored
fix #33

* comply to code style
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.

1 participant