fix: ensure binary is executable after npm install (#229)

This commit is contained in:
Chris Tate
2026-01-23 15:40:46 -06:00
committed by GitHub
parent 65d4df84ac
commit 957b5e5994
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"agent-browser": patch
---
Fix binary permissions on install. npm doesn't preserve execute bits, so postinstall now ensures the native binary is executable.
+5 -1
View File
@@ -68,7 +68,11 @@ async function downloadFile(url, dest) {
async function main() {
// Check if binary already exists
if (existsSync(binaryPath)) {
console.log(`✓ Native binary already exists: ${binaryName}`);
// Ensure binary is executable (npm doesn't preserve execute bit)
if (platform() !== 'win32') {
chmodSync(binaryPath, 0o755);
}
console.log(`✓ Native binary ready: ${binaryName}`);
return;
}