tarmolov / git-hooks-js

A tool to manage and run project git hooks
167 stars 30 forks source link

spawned process stdio options not passed properly #33

Closed maxlath closed 7 years ago

maxlath commented 7 years ago

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 commented 7 years ago

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'});