Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var handleError = function (error) {
var lineNumber = (error.lineNumber) ? 'LINE ' + error.lineNumber + ' -- ' : '';
notify({
title: 'Task Failed [' + error.plugin + ']',
message: lineNumber + 'See console.'
}, notify.logLevel(0)).write(error);
// Inspect the error object
//console.log(error);
// Easy error reporting
//console.log(error.toString());
// Pretty error reporting
var report = '';
report += chalk.white.bgRed('TASK:') + ' [' + error.plugin + ']\n';
report += chalk.white.bgRed('ERROR:') + ' ' + error.message + '\n';
if (error.lineNumber) { report += chalk.red('LINE:') + ' ' + error.lineNumber + '\n'; }
if (error.fileName) { report += chalk.red('FILE:') + ' ' + error.fileName + '\n'; }
console.error(report);
'use strict';
/**
* Module dependencies
*/
var fs = require('fs'),
path = require('path'),
notify = require('gulp-notify');
// don't need duplicated error messages
notify.logLevel(0);
// load the tasks
fs.readdirSync('./config/gulp/tasks/')
.filter(function (name) {
return /(\.(js)$)/i.test(path.extname(name));
})
.forEach(function (task) {
require(path.resolve('./config/gulp/tasks/', task));
});
gulp.task('watch-client', function() {
return gulp.watch('client/**/*.js', ['compile-client', 'build-dev-client']);
});
gulp.task('clean', () => {
return del(['dist']);
});
gulp.task('default', ['compile', 'build', 'watch']);
gulp.task('release', ['compile', 'build-release']);
// avoid logging to the console
// that we created a notification
notify_.logLevel(0);
// notification helper
function notify(msg) {
return notify_({
title: 'AFTR',
message: msg,
icon: false,
onLast: true,
});
}
gulp.task('stop-chromedriver', () => {
try {
if (isWindows) {
childProcess.execSync('taskkill /im chromedriver* /t /f', { stdio: 'ignore' })
} else {
childProcess.execSync('pkill chromedriver', { stdio: 'ignore' })
}
} catch(ex) {
// Do nothing
}
})
// avoid logging to the console
// that we created a notification
notify_.logLevel(0)
// notification helper
function notify (msg) {
return notify_({
title: '▲ Next',
message: msg,
icon: false,
onLast: true
})
}
var del = require('del');
var gulp = require('gulp');
var myth = require('gulp-myth');
var util = require('gulp-util');
var notify = require('gulp-notify');
var rename = require('gulp-rename');
var source = require('vinyl-source-stream');
var uglify = require('gulp-uglify');
var babelify = require('babelify');
var watchify = require('watchify');
var Immutable = require('immutable');
var streamify = require('gulp-streamify');
var browserify = require('browserify');
var runSequence = require('run-sequence');
notify.logLevel(0);
var paths = {
js: {
src: './js/app.jsx',
dest: 'bundle.js'
},
css: {
all: './css/**/*.css',
src: './css/app.css'
},
dist: './dist'
};
var browserifyOpts = Immutable.Map({ from: paths.js.src, to: paths.js.dest, dist: paths.dist });
var watchifyOpts = browserifyOpts.set('watch', true);
message(message) {
notify.logLevel(0);
return notify({
title: this.title,
message: message,
icon: __dirname + '/../icons/laravel.png',
onLast: true
});
}