From bfe02124e494103e4460700895525ba337b639f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Correa=20Casablanca?= Date: Mon, 21 Nov 2022 14:27:48 +0100 Subject: [PATCH] fix: apply chmod at pkg creation time (#3800) Fixes https://github.com/rome/tools/issues/3799 --- npm/rome/scripts/generate-packages.mjs | 1 + npm/rome/scripts/postinstall.js | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/npm/rome/scripts/generate-packages.mjs b/npm/rome/scripts/generate-packages.mjs index e231ffb5ef0..0fea1d0dbb8 100644 --- a/npm/rome/scripts/generate-packages.mjs +++ b/npm/rome/scripts/generate-packages.mjs @@ -44,6 +44,7 @@ function generateNativePackage(platform, arch) { console.log(`Copy binary ${binaryTarget}`); fs.copyFileSync(binarySource, binaryTarget); + fs.chmodSync(binaryTarget, 0o755); } function updateWasmPackage(target) { diff --git a/npm/rome/scripts/postinstall.js b/npm/rome/scripts/postinstall.js index 392c13c4b65..8cff68be341 100644 --- a/npm/rome/scripts/postinstall.js +++ b/npm/rome/scripts/postinstall.js @@ -25,17 +25,6 @@ if (binName) { `The Rome CLI postinstall script failed to resolve the binary file "${binName}". Running Rome from the npm package will probably not work correctly.`, ); } - - if (binPath) { - try { - require("fs").chmodSync(binPath, 0o755); - } catch { - console.warn( - "The Rome CLI postinstall script failed to set execution permissions to the native binary. " + - "Running Rome from the npm package will probably not work correctly.", - ); - } - } } else { console.warn( "The Rome CLI package doesn't ship with prebuilt binaries for your platform yet. " +