Skip to content

Commit

Permalink
fix(create): copy cache to dest
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 14, 2024
1 parent 81e98a7 commit db83b69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/create/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-cordis",
"description": "Setup a Cordis application",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Scaffold {
const cacheDir = join(paths.cache, '.yarn/releases')
const cacheFile = join(cacheDir, `yarn-${version}.cjs`)
try {
await access(join(cacheDir, `yarn-${version}.cjs`))
await access(cacheFile)
} catch {
const tempDir = join(paths.temp, '@yarnpkg/cli-dist')
await mkdir(tempDir, { recursive: true })
Expand All @@ -120,7 +120,7 @@ class Scaffold {
const targetDir = join(rootDir, '.yarn/releases')
const targetFile = join(targetDir, `yarn-${version}.cjs`)
await mkdir(targetDir, { recursive: true })
await copyFile(targetFile, cacheFile)
await copyFile(cacheFile, targetFile)
return version
}

Expand Down

0 comments on commit db83b69

Please sign in to comment.