-
Notifications
You must be signed in to change notification settings - Fork 657
fix: apply chmod at pkg creation time #3800
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to move the resolution failure messages to the rome start script instead and avoid using postinstall scripts altogether? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
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. " + | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same way there is a
try-catch
block for thechmodSync
call in thepostinstall
hook code, we could do the same here, because in theory it can fail the same way. However, that applies to every IO operation in this script (likecopy
), but that's not done here (I guess because it doesn't improve much on the potential error messages we could have, and because the pipeline would have crashed anyway).