Skip to content

Commit e1c5b16

Browse files
committed
fix(postinstall): use writeFileSync to ensure file is flushed before tar
1 parent b22b469 commit e1c5b16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/postinstall.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import { createRequire } from "node:module";
1010
import { execSync } from "node:child_process";
1111
import {
12-
createWriteStream,
1312
existsSync,
1413
mkdirSync,
1514
chmodSync,
1615
unlinkSync,
16+
writeFileSync,
1717
} from "node:fs";
1818
import { homedir } from "node:os";
1919
import { join, dirname } from "node:path";
@@ -97,7 +97,7 @@ async function download(url, outPath) {
9797
`Download incomplete: got ${buffer.length} bytes, expected ${total}`,
9898
);
9999
}
100-
createWriteStream(outPath).end(buffer);
100+
writeFileSync(outPath, buffer);
101101
process.stderr.write(
102102
` Downloaded ${(buffer.length / 1024 / 1024).toFixed(0)} MB\n`,
103103
);

0 commit comments

Comments
 (0)