mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
refactor(npm): Use util function for cache dir creation (#10591)
This commit is contained in:
parent
21d2aeb720
commit
d2b0f4d98b
1 changed files with 11 additions and 19 deletions
|
@ -11,7 +11,7 @@ import { ExternalHostError } from '../../../types/errors/external-host-error';
|
||||||
import { getChildProcessEnv } from '../../../util/exec/env';
|
import { getChildProcessEnv } from '../../../util/exec/env';
|
||||||
import {
|
import {
|
||||||
deleteLocalFile,
|
deleteLocalFile,
|
||||||
ensureDir,
|
ensureCacheDir,
|
||||||
getSiblingFileName,
|
getSiblingFileName,
|
||||||
getSubDirectory,
|
getSubDirectory,
|
||||||
outputFile,
|
outputFile,
|
||||||
|
@ -434,24 +434,16 @@ export async function getAdditionalFiles(
|
||||||
|
|
||||||
const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();
|
const { additionalNpmrcContent, additionalYarnRcYml } = processHostRules();
|
||||||
|
|
||||||
const env = getChildProcessEnv([
|
const env = {
|
||||||
'NPM_CONFIG_CACHE',
|
...getChildProcessEnv(),
|
||||||
'YARN_CACHE_FOLDER',
|
NPM_CONFIG_CACHE: await ensureCacheDir('./others/npm', 'NPM_CONFIG_CACHE'),
|
||||||
'npm_config_store',
|
YARN_CACHE_FOLDER: await ensureCacheDir(
|
||||||
]);
|
'./others/yarn',
|
||||||
env.NPM_CONFIG_CACHE =
|
'YARN_CACHE_FOLDER'
|
||||||
env.NPM_CONFIG_CACHE ||
|
),
|
||||||
upath.join(getAdminConfig().cacheDir, './others/npm');
|
npm_config_store: await ensureCacheDir('./others/pnpm', 'npm_config_store'),
|
||||||
await ensureDir(env.NPM_CONFIG_CACHE);
|
NODE_ENV: 'dev',
|
||||||
env.YARN_CACHE_FOLDER =
|
};
|
||||||
env.YARN_CACHE_FOLDER ||
|
|
||||||
upath.join(getAdminConfig().cacheDir, './others/yarn');
|
|
||||||
await ensureDir(env.YARN_CACHE_FOLDER);
|
|
||||||
env.npm_config_store =
|
|
||||||
env.npm_config_store ||
|
|
||||||
upath.join(getAdminConfig().cacheDir, './others/pnpm');
|
|
||||||
await ensureDir(env.npm_config_store);
|
|
||||||
env.NODE_ENV = 'dev';
|
|
||||||
|
|
||||||
let token = '';
|
let token = '';
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue