Skip to content

Commit eccc5f8

Browse files
committed
chore: sync-template-deps
1 parent a417ebb commit eccc5f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/sync-template-deps.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ async function regenerateLockfile(templateDir: string, manager: ManagerInfo): Pr
557557
else {
558558
const yarnVersion = manager.version ?? DEFAULT_YARN_VERSION
559559
const yarnMajor = Number.parseInt((yarnVersion.split('.')[0] ?? '1') as string, 10)
560+
const yarnCacheDir = path.join(directory, '.yarn-cache')
561+
ensureDir(yarnCacheDir)
560562
const args = [
561563
'dlx',
562564
`yarn@${yarnVersion}`,
@@ -570,11 +572,18 @@ async function regenerateLockfile(templateDir: string, manager: ManagerInfo): Pr
570572
else {
571573
args.push('--prefer-offline', '--no-progress')
572574
}
575+
args.push('--cache-folder', yarnCacheDir)
573576
success = await runCommand(
574577
'pnpm',
575578
args,
576579
directory,
577-
{ allowFailure: true, timeoutMs: LOCK_UPDATE_TIMEOUT_MS },
580+
{
581+
allowFailure: true,
582+
timeoutMs: LOCK_UPDATE_TIMEOUT_MS,
583+
env: {
584+
YARN_CACHE_FOLDER: yarnCacheDir,
585+
},
586+
},
578587
)
579588
}
580589

0 commit comments

Comments
 (0)