Skip to content

Commit

Permalink
fix(gulp): handle gulpfile edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Mar 28, 2016
1 parent 9219fee commit 83bbab6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ Cli.run = function run(processArgv) {
logging.logger.debug('Gulpfile found');
var beforeHook = argv._[0] + ':before';
var afterHook = argv._[0] + ':after';
var gulp = require(path.resolve(process.cwd() + '/node_modules/gulp'));
try {
var gulp = require(path.resolve(process.cwd() + '/node_modules/gulp'));
} catch(e) {
// Empty gulpfile (or one that doesn't require gulp?), and no gulp
console.error('Gulpfile detected, but gulp is not installed');
console.error('Do you need to npm install?\n');
process.exit(1);
}
logEvents(gulp);

return Q.nfcall(gulp.start.bind(gulp), beforeHook).then(
Expand Down

0 comments on commit 83bbab6

Please sign in to comment.