Skip to content

Commit 3538dcc

Browse files
Tyler Kellenphated
authored andcommitted
Update: Change the cwd if needed
1 parent 3caa62d commit 3538dcc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

bin/hacker.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Hacker = new Liftoff({
1010
extensions: require('interpret').jsVariants,
1111
// ^ automatically attempt to require module for any javascript variant
1212
// supported by interpret. e.g. coffee-script / livescript, etc
13-
v8flags: ['--harmony'] // to support all flags: require('v8flags').fetch();
13+
v8flags: ['--harmony'] // to support all flags: require('v8flags') pull;
1414
// ^ respawn node with any flag listed here
1515
}).on('require', function (name, module) {
1616
console.log('Loading:',name);
@@ -44,8 +44,12 @@ function invoke (env) {
4444
console.log('CLI PACKAGE.JSON', require('../package'));
4545
}
4646

47-
if(env.configPath) {
48-
process.chdir(env.configBase);
47+
if (process.cwd() !== env.cwd) {
48+
process.chdir(env.cwd);
49+
console.log('Working directory changed to', env.cwd);
50+
}
51+
52+
if (env.configPath) {
4953
require(env.configPath);
5054
} else {
5155
console.log('No Hackerfile found.');

0 commit comments

Comments
 (0)