test: robust handling of env for npm-test-install
Currently we are overwriting the entire env object of the child-process spawned in `npm-test-install`. This commit alternatively clones the `process.env` object and modifies it with the neccessary changes before passing it the the spawned process. Fixes: https://github.com/nodejs/node/issues/6736 PR-URL: https://github.com/nodejs/node/pull/6797 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
149bea0fc4
commit
56ae651c80
@ -32,11 +32,12 @@ const pkgPath = path.join(common.tmpDir, 'package.json');
|
||||
|
||||
fs.writeFileSync(pkgPath, pkgContent);
|
||||
|
||||
const env = Object.create(process.env);
|
||||
env['PATH'] = path.dirname(process.execPath);
|
||||
|
||||
const proc = spawn(process.execPath, args, {
|
||||
cwd: common.tmpDir,
|
||||
env: {
|
||||
PATH: path.dirname(process.execPath)
|
||||
}
|
||||
env: env
|
||||
});
|
||||
|
||||
function handleExit(code, signalCode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user