m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

No callback if command not found #35

Closed nfantone closed 8 years ago

nfantone commented 9 years ago

When running a command that doesn't exist, no error callback is generated and the task exits abruptly.

For example,

gulp.task('runme', function(cb) {
    new $.run.Command('nonexistant').exec(functioen (err) {
      console.log('This is where I'm supposed to tell you that I do not exist', err);
      cb(err);
    });
});

Running gulp runme just outputs:

[14:38:48] Using gulpfile ~/myproject/gulpfile.js
[14:38:48] Starting 'runme'...
nfantone@ubuntu-laptop ~/myproject $ echo $?
0

And ends silently with status 0.

It would be useful to inform the user that the command/binary that is to be run is not installed in the system and raise a non-zero error status (like POSIX sh standard, 127).

nfantone commented 9 years ago

Up for a PR?