Skip to content

Commit

Permalink
fix(create): use copyFile instead of rename, fix satorijs/satori#305
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 15, 2024
1 parent 78837b3 commit ed598ee
Show file tree
Hide file tree
Showing 2 changed files with 5 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.3",
"version": "0.2.4",
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/create/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { access, copyFile, mkdir, readdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises'
import { access, copyFile, mkdir, readdir, readFile, rm, stat, writeFile } from 'node:fs/promises'
import { execSync } from 'node:child_process'
import { basename, join, relative } from 'node:path'
import { Readable } from 'node:stream'
Expand Down Expand Up @@ -114,7 +114,9 @@ class Scaffold {
stream.on('finish', resolve)
stream.on('error', reject)
})
await rename(join(tempDir, 'yarn.js'), cacheFile)
// https://github.com/satorijs/satori/issues/305
await copyFile(join(tempDir, 'yarn.js'), cacheFile)
await rm(tempDir, { recursive: true })
}

const targetDir = join(rootDir, '.yarn/releases')
Expand Down

0 comments on commit ed598ee

Please sign in to comment.