Skip to content

Commit 63a29e9

Browse files
committed
fix: use chmodSync instead of async chmod for downloaded binaries
Prevents 'Text file busy' errors by ensuring file system operations complete synchronously before attempting to execute downloaded binaries.
1 parent 88bbe26 commit 63a29e9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/releases/github.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
* ```
4545
*/
4646

47-
import { existsSync } from 'node:fs'
48-
import { chmod, readFile, writeFile } from 'node:fs/promises'
47+
import { chmodSync, existsSync } from 'node:fs'
48+
import { readFile, writeFile } from 'node:fs/promises'
4949
import path from 'node:path'
5050

5151
import { safeMkdir } from '../fs.js'
@@ -488,7 +488,7 @@ export async function downloadGitHubRelease(
488488
// Make executable on Unix-like systems.
489489
const isWindows = binaryName.endsWith('.exe')
490490
if (!isWindows) {
491-
await chmod(binaryPath, 0o755)
491+
chmodSync(binaryPath, 0o755)
492492

493493
// Remove macOS quarantine attribute if present (only on macOS host for macOS target).
494494
if (

0 commit comments

Comments
 (0)