handleErrors.js 452 B

123456789101112131415161718
  1. import gutil from 'gulp-util';
  2. import config from '../../config';
  3. import notifier from 'node-notifier';
  4. export default function(error) {
  5. // Send error to notification center with gulp-notify
  6. if (config.enable.notify) {
  7. notifier.notify({
  8. title: config.notify.title,
  9. subtitle: 'Failure!',
  10. message: error.message,
  11. });
  12. }
  13. gutil.log(gutil.colors.red(error));
  14. // Keep gulp from hanging on this task
  15. this.emit('end');
  16. }