Skip to content

Commit

Permalink
different strategy for env
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Jan 29, 2024
1 parent 28cd913 commit beaad11
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/temporal-polyfill/scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ yargs(hideBin(process.argv))
], {
cwd: process.cwd(),
env: {
...filterEnv(process.env),
// will force PNPM to use a specific version (see .npmrc)
NODE_VERSION: options.nodeVersion,
PATH: process.env.PATH,
CI: process.env.CI,
}
})
}
Expand Down Expand Up @@ -142,3 +141,15 @@ function liveExec(cmdParts, options = {}) {
})
})
}

function filterEnv(oldEnv) {
const newEnv = {}

for (const key in oldEnv) {
if (!/node|npm|nvm/i.test(key)) {
newEnv[key] = oldEnv[key]
}
}

return newEnv
}

0 comments on commit beaad11

Please sign in to comment.