From 960b64e6f03924ad5d838d0ada074069ff22c215 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 13 Aug 2021 13:49:49 +0200 Subject: [PATCH] chore: npm env settings style --- lib/manager/npm/post-update/index.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/manager/npm/post-update/index.ts b/lib/manager/npm/post-update/index.ts index b8268c4ef2..3c9d42710d 100644 --- a/lib/manager/npm/post-update/index.ts +++ b/lib/manager/npm/post-update/index.ts @@ -420,16 +420,14 @@ export async function getAdditionalFiles( const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules(); - const env = getChildProcessEnv([ - 'NPM_CONFIG_CACHE', - 'YARN_CACHE_FOLDER', - 'npm_config_store', - ]); - env.NPM_CONFIG_CACHE = await ensureCacheDir('npm'); - env.YARN_CACHE_FOLDER = await ensureCacheDir('yarn'); - env.YARN_GLOBAL_FOLDER = await ensureCacheDir('berry'); - env.npm_config_store = await ensureCacheDir('pnpm'); - env.NODE_ENV = 'dev'; + const env = { + ...getChildProcessEnv(), + NPM_CONFIG_CACHE: await ensureCacheDir('npm'), + YARN_CACHE_FOLDER: await ensureCacheDir('yarn'), + YARN_GLOBAL_FOLDER: await ensureCacheDir('berry'), + npm_config_store: await ensureCacheDir('pnpm'), + NODE_ENV: 'dev', + }; let token = ''; try {