Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
fix: apply chmod at pkg creation time
Browse files Browse the repository at this point in the history
apply chmod at package creation time instead of doing it when running
the postinstall hook.

Signed-off-by: Andres Correa Casablanca <castarco@coderspirit.xyz>
  • Loading branch information
castarco committed Nov 19, 2022
1 parent 861eb07 commit fc19e89
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions npm/rome/scripts/generate-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function generateNativePackage(platform, arch) {

console.log(`Copy binary ${binaryTarget}`);
fs.copyFileSync(binarySource, binaryTarget);
fs.chmodSync(binaryTarget, 0o755);
}

function updateWasmPackage(target) {
Expand Down
11 changes: 0 additions & 11 deletions npm/rome/scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. " +
Expand Down

0 comments on commit fc19e89

Please sign in to comment.