fix(windows): handle undefined environment variables in runCommandWithTimeout
This commit is contained in:
parent
57d98eb1d7
commit
950377f041
@ -73,7 +73,11 @@ export async function runCommandWithTimeout(
|
||||
return false;
|
||||
})();
|
||||
|
||||
const resolvedEnv = env ? { ...process.env, ...env } : { ...process.env };
|
||||
const resolvedEnv = Object.fromEntries(
|
||||
Object.entries({ ...process.env, ...(env ?? {}) })
|
||||
.filter(([, value]) => value !== undefined)
|
||||
.map(([key, value]) => [key, String(value)]),
|
||||
);
|
||||
if (shouldSuppressNpmFund) {
|
||||
if (resolvedEnv.NPM_CONFIG_FUND == null) resolvedEnv.NPM_CONFIG_FUND = "false";
|
||||
if (resolvedEnv.npm_config_fund == null) resolvedEnv.npm_config_fund = "false";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user