Skip to content

Commit

Permalink
feat(hooks): print newline after gulp tasks have finished
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Mar 28, 2016
1 parent e897dac commit c8643b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function runWithGulp(argv, taskInstance){
console.error('Do you need to run `npm install`?\n');
process.exit(1);
}
logEvents(gulp);
logEvents(gulp, [beforeHook, afterHook]);

if (gulp.tasks[beforeHook]) {
console.info('\nRunning \'' + beforeHook + '\' Gulp task before ' + cmdName);
Expand Down Expand Up @@ -207,7 +207,7 @@ function loadGulpfile(){
return false;
}

function logEvents(gulpInst) {
function logEvents(gulpInst, finalTaskNames) {
gulpInst.on('task_start', function(e) {
// TODO: batch these
// so when 5 tasks start at once it only logs one time with all 5
Expand All @@ -220,6 +220,9 @@ function logEvents(gulpInst) {
'Finished', '\'' + chalk.cyan(e.task) + '\'',
'after', chalk.magenta(time)
);
if (finalTaskNames.indexOf(e.task) > -1) {
console.log();
}
});

gulpInst.on('task_err', function(e) {
Expand Down

0 comments on commit c8643b7

Please sign in to comment.