Skip to content

Console clutter when passing no images #11

Description

@tjgavlick

Hi there! Thanks for the extremely useful plugin.

My issue is that when no images are passed through to this plugin (for example, filtering via newer after a delete event), I get a console error:

{ Error: Command failed: bash node_modules/gulp-imageoptim/scripts/optimize.bash 06962c9b44b38b68736f1c7e7d8d2b81 

    at ChildProcess.exithandler (child_process.js:205:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:511:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'bash node_modules/gulp-imageoptim/scripts/optimize.bash 06962c9b44b38b68736f1c7e7d8d2b81 ' }

Gulp does not exit and subsequent watch events execute properly, so functionally, everything is working fine. Just wondering if this error can be accounted for so my users don't get alarmed by scary-looking errors in their consoles. Or, if there's a way I should be handling this error on my side, let me know.

edit: for reference, I am using pump in place of pipe. Here's my imageOptim task:

let out = 'dist/images';
pump(
  [
    gulp.src(imageFiles),
    newer(out),
    imageOptim.optimize(),
    gulp.dest(out)
  ],
  done
);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions