build(cli): chmod +x dist/cli/index.js after webpack bundle#689
Merged
build(cli): chmod +x dist/cli/index.js after webpack bundle#689
Conversation
Webpack does not preserve the executable bit on output bundles, so the `opensafari` bin entry (`./dist/cli/index.js`) lands as `0644` after a fresh `npm run build`. The existing `npm link` shim (`/opt/homebrew/bin/opensafari` → `dist/cli/index.js`) then fails with `permission denied` until the file is manually `chmod +x`'d. Add the same `&& chmod +x` suffix that `build:ax-bridge-cli` and `build:sim-hid-bridge-cli` already use for their bin outputs. No other build script change is needed; the shebang is already emitted by the existing webpack config. Verified locally: fresh `npm run build:cli` now produces `-rwxr-xr-x dist/cli/index.js` and `opensafari --version` succeeds. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Webpack does not preserve the executable bit on bundled output, so a fresh
npm run buildlandsdist/cli/index.jsas0644. Thebinentry inpackage.json(opensafari→./dist/cli/index.js) then fails when invoked through thenpm linkshim:Fix
Append
&& chmod +x dist/cli/index.jstobuild:cli, matching the existing pattern already used bybuild:ax-bridge-cliandbuild:sim-hid-bridge-clifor their respective binaries.Verification
rm -rf dist && npm run build:cli→-rwxr-xr-x dist/cli/index.jsopensafari --version→ prints0.6.0Test plan
opensafari --helpworks through the existing globalnpm linkshim🤖 Generated with Claude Code