Skip to content

Commit d7b14d6

Browse files
cknittcristianoc
authored andcommitted
Fix Windows CI
1 parent 3a69990 commit d7b14d6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/copyExes.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ if (!fs.existsSync(platformBinDir)) {
2020
}
2121

2222
function copyExe(exe) {
23+
const ext = process.platform === "win32" ? ".exe" : "";
24+
const src = path.join(duneBinDir, exe + ext);
2325
const dest = path.join(platformBinDir, exe + ".exe");
2426

25-
const ext = process.platform === "win32" ? ".exe" : "";
26-
fs.copyFileSync(path.join(duneBinDir, exe + ext), dest);
27+
// For some reason, the copy operation fails in Windows CI if the file already exists.
28+
if (process.platform === "win32" && fs.existsSync(dest)) {
29+
fs.rmSync(dest);
30+
}
31+
32+
fs.copyFileSync(src, dest);
2733

2834
if (process.platform !== "win32") {
2935
child_process.execSync(`strip ${dest}`);

0 commit comments

Comments
 (0)