diff --git a/lib/set-envs.js b/lib/set-envs.js index 0893337..af6ea58 100644 --- a/lib/set-envs.js +++ b/lib/set-envs.js @@ -59,7 +59,7 @@ const setEnvs = (config) => { else env.PREFIX = globalPrefix - env.INIT_CWD = env.INIT_CWD || process.cwd() + env.INIT_CWD = process.cwd() // if the key is the default value, // if the environ is NOT the default value, diff --git a/test/set-envs.js b/test/set-envs.js index 3854d71..04c3012 100644 --- a/test/set-envs.js +++ b/test/set-envs.js @@ -53,14 +53,14 @@ t.test('set envs that are not defaults and not already in env, array style', t = const cliConf = Object.create(envConf) const extras = { NODE, - INIT_CWD: '/some/other/path', + INIT_CWD: cwd, EDITOR: 'vim', HOME: undefined, PREFIX: undefined, npm_execpath: require.main.filename, npm_node_execpath: execPath, } - // make sure it's sticky + // make sure it's not sticky const env = { INIT_CWD: '/some/other/path' } const config = { list: [cliConf, envConf], env, defaults, execPath } setEnvs(config)