Skip to content

Commit c17d268

Browse files
committed
fix(hooks): don't require Gulpfile twice
1 parent a48e7b9 commit c17d268

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/cli.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,10 @@ Cli.run = function run(processArgv) {
194194

195195
function loadGulp(){
196196
var names = ['gulpfile.js', 'Gulpfile.js'];
197-
var found = false;
198197
for (var i = 0, ii = names.length; i < ii; i++) {
199198
try {
200199
require(path.resolve(process.cwd() + '/' + names[i]));
201-
found = true;
200+
return true;
202201
} catch(e){
203202
if (e instanceof SyntaxError) {
204203
console.error('\nThere is a syntax error in your gulpfile:');
@@ -213,7 +212,7 @@ function loadGulp(){
213212
}
214213
}
215214
}
216-
return found;
215+
return false;
217216
}
218217

219218
function logEvents(gulpInst) {

0 commit comments

Comments
 (0)