Skip to content

Commit

Permalink
New: Add support for --continue flag
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 21, 2017
1 parent 5e09eec commit 2a8bfd0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ var usage =
var parser = yargs.usage(usage, cliOptions);
var opts = parser.argv;

// this translates the --continue flag in gulp
// to the settle env variable for undertaker
// we use the process.env so the user's gulpfile
// can know about the flag
if (opts.continue) {
process.env.UNDERTAKER_SETTLE = 'true';
}

// This is a hold-over until we have a better logging system
// with log levels
var shouldLog = !opts.silent && !opts.tasksSimple;
Expand Down
5 changes: 5 additions & 0 deletions lib/shared/cliOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ module.exports = {
desc: chalk.gray(
'Suppress all gulp logging.'),
},
continue: {
type: 'boolean',
desc: chalk.gray(
'Continue execution of tasks upon failure.'),
},
};
7 changes: 5 additions & 2 deletions lib/versioned/^4.0.0-alpha.1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ function execute(opts, env) {
}
try {
gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath)));
// TODO: do we care about the error/result from calling this?
gulpInst.parallel(toRun)();
gulpInst.parallel(toRun)(function(err) {
if (err) {
exit(1);
}
});
} catch (err) {
gutil.log(chalk.red(err.message));
gutil.log(
Expand Down
1 change: 0 additions & 1 deletion lib/versioned/^4.0.0-alpha.1/log/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function logEvents(gulpInst) {
chalk.magenta(time)
);
gutil.log(msg);
process.exit(1);
});
}

Expand Down

0 comments on commit 2a8bfd0

Please sign in to comment.