JD2022-TU1/data/EngineData/JustDanceTools/gulp/util/handleErrors.js

26 lines
590 B
JavaScript

import gutil from 'gulp-util';
import notify from 'gulp-notify';
export default function(error) {
if( !global.isProd ) {
const args = Array.prototype.slice.call(arguments);
// Send error to notification center with gulp-notify
notify.onError({
title: 'Compile Error',
message: '<%= error.message %>'
}).apply(this, args);
// Keep gulp from hanging on this task
this.emit('end');
} else {
// Log the error and stop the process
// to prevent broken code from building
gutil.log(gutil.colors.red(error));
process.exit(1);
}
};