Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task(task.name, function(cb) {
var cwd = process.cwd();
var _args = args.slice();
_args.push(function() {
// restore current working directory (see #23)
process.chdir(cwd);
cb.apply(null, arguments);
});
runSequence.apply(null, _args);
});
};
gulp.task('all', ['clean'], function (cb) {
var tasks = Object.keys(this.tasks).filter(function (k) { return /^test\d+/.test(k) });
tasks.sort(function (a, b) { return a.match(/\d+/)[0] - b.match(/\d+/)[0] });
tasks.push(cb);
sequence.apply(null, tasks);
});
});
gulp.task('watch:kss', function() {
return gulp.watch(argv.kssSource, ['styleguide:generate']);
});
gulp.task('watch:styles', function() {
return gulp.watch(argv.styleSource, ['styleguide:applystyles']);
});
if (argv.watch) {
tasks.push('watch:styles');
tasks.push('watch:kss');
}
runSequence.apply(this, tasks);
} catch (err) {
console.error('Style guide generation failed');
logError(err);
}
};
});
gulp.task('watch:kss', function() {
return gulp.watch(argv.kssSource, ['styleguide:generate']);
});
gulp.task('watch:styles', function() {
return gulp.watch(argv.styleSource, ['styleguide:applystyles']);
});
if (argv.watch) {
tasks.push('watch:styles');
tasks.push('watch:kss');
}
runSequence.apply(this, tasks);
} catch (err) {
console.error('Style guide generation failed');
logError(err);
}
};
gulp.task('build', ['clean'], function (cb) {
var task_seq = [['style', 'image', 'html', 'script'], cb];
runSequence.apply(null, task_seq);
});
gulp.task('build', ['clean'], function (cb) {
var task_seq = [['style', 'image', 'html', 'script'], cb];
runSequence.apply(null, task_seq);
});
gulp.task('default', function (cb) {
var task_seq = ['build'];
if (yargs.s) {
task_seq.push('server');
}
if (yargs.w) {
task_seq.push('watch');
}
task_seq.push(cb);
runSequence.apply(null, task_seq);
});
gulp.task('build', ['clean'], function (cb) {
var task_seq = [['style', 'image', 'html', 'script'], cb];
if (yargs.r) {
task_seq = [['style', 'image', 'html', 'script'], 'rev', 'inline', cb];
}
runSequence.apply(null, task_seq);
});
gulp.task('build', function(callback) {
var args = ['clean', ['css', 'content', 'js', 'html']]
if (env == 'stage' || env == 'prod') args.unshift('lint')
if (cordova) args.push('cordova')
args.push(callback)
sequence.apply(null, args)
})
gulp.task("test_output_pjs", function(callback) {
var sequence = pjs_tests.map(function(test) {
return "test_output_pjs_" + test;
});
sequence.push(callback);
runSequence.apply(null, sequence);
});