Skip to content

Commit d131229

Browse files
committed
fix: replace renameSync with cpSync to prevent EXDEV on Ubuntu
renameSync fails with 'EXDEV: cross-device link not permitted' when moving files from /tmp (tmpfs) to the project directory (ext4) on Ubuntu. Use cpSync with recursive and force options instead, which works across filesystem boundaries.
1 parent 90753e4 commit d131229

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/desktop/scripts/ensure-pty-prebuilds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
import { execFileSync } from 'node:child_process'
1717
import { createHash, timingSafeEqual } from 'node:crypto'
1818
import {
19+
cpSync,
1920
existsSync,
2021
mkdirSync,
2122
mkdtempSync,
2223
readFileSync,
23-
renameSync,
2424
rmSync,
2525
writeFileSync,
2626
} from 'node:fs'
@@ -103,7 +103,7 @@ async function fetchPrebuild(arch: string, version: string): Promise<void> {
103103
const target = packageDir(arch)
104104
mkdirSync(dirname(target), { recursive: true })
105105
rmSync(target, { recursive: true, force: true })
106-
renameSync(join(staging, 'package'), target)
106+
cpSync(join(staging, 'package'), target, { recursive: true, force: true })
107107
} finally {
108108
rmSync(staging, { recursive: true, force: true })
109109
}

0 commit comments

Comments
 (0)