Skip to content

Commit 9c53ffc

Browse files
committed
fix(cli): report gulpfile errors
1 parent 984f46f commit 9c53ffc

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lib/cli.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,20 @@ function loadGulpfile(){
235235
require(path.resolve(process.cwd() + '/' + names[i]));
236236
return true;
237237
} catch(e){
238-
if (e instanceof SyntaxError) {
239-
console.error('\nThere is a syntax error in your gulpfile:');
240-
console.error(e.message)
241-
process.exit(1);
242-
}
243-
if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf(names[i]) === -1) {
244-
console.log('Uh oh! Looks like you\'re missing a module in your gulpfile:');
245-
console.error(e.message);
246-
console.log('\nDo you need to run `npm install`?\n');
247-
process.exit(1);
238+
if (e.code === 'MODULE_NOT_FOUND') {
239+
if (e.message.indexOf(names[i]) === -1) {
240+
console.log('Uh oh! Looks like you\'re missing a module in your gulpfile:');
241+
console.error(e.message);
242+
console.log('\nDo you need to run `npm install`?\n');
243+
process.exit(1);
244+
} else {
245+
// ignore missing gulpfile
246+
continue
247+
}
248248
}
249+
console.error('There is an error in your gulpfile: ')
250+
console.error(e.stack);
251+
process.exit(1);
249252
}
250253
}
251254
return false;

0 commit comments

Comments
 (0)