Skip to content

Commit 8e3fe8f

Browse files
author
Contra
committed
chdir before requiring gulpfile to not interfere after it is loaded
1 parent c360ca1 commit 8e3fe8f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bin/gulp.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ function handleArguments(env) {
6060
gutil.log(chalk.red('Local gulp (installed in gulpfile dir) is', env.modulePackage.version));
6161
}
6262

63+
// chdir before requiring gulpfile to make sure
64+
// we let them chdir as needed
65+
if (process.cwd() !== env.cwd) {
66+
process.chdir(env.cwd);
67+
gutil.log('Working directory changed to', chalk.magenta(tildify(env.cwd)));
68+
}
69+
6370
var gulpFile = require(env.configPath);
6471
gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath)));
6572

6673
var gulpInst = require(env.modulePath);
6774
logEvents(gulpInst);
6875

69-
if (process.cwd() !== env.cwd) {
70-
process.chdir(env.cwd);
71-
gutil.log('Working directory changed to', chalk.magenta(tildify(env.cwd)));
72-
}
73-
7476
process.nextTick(function() {
7577
if (tasksFlag) {
7678
return logTasks(gulpFile, gulpInst);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gulp",
33
"description": "The streaming build system",
4-
"version": "3.6.1",
4+
"version": "3.6.2",
55
"homepage": "http://gulpjs.com",
66
"repository": "gulpjs/gulp",
77
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)",

0 commit comments

Comments
 (0)