fix: ensure binary is executable after npm install (#229)
This commit is contained in:
@@ -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.
|
||||||
@@ -68,7 +68,11 @@ async function downloadFile(url, dest) {
|
|||||||
async function main() {
|
async function main() {
|
||||||
// Check if binary already exists
|
// Check if binary already exists
|
||||||
if (existsSync(binaryPath)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user