Skip to content

build(cli): chmod +x dist/cli/index.js after webpack bundle#689

Merged
shaun0927 merged 1 commit intodevelopfrom
fix/postbuild-chmod-cli
Apr 27, 2026
Merged

build(cli): chmod +x dist/cli/index.js after webpack bundle#689
shaun0927 merged 1 commit intodevelopfrom
fix/postbuild-chmod-cli

Conversation

@shaun0927
Copy link
Copy Markdown
Owner

Summary

Webpack does not preserve the executable bit on bundled output, so a fresh npm run build lands dist/cli/index.js as 0644. The bin entry in package.json (opensafari./dist/cli/index.js) then fails when invoked through the npm link shim:

$ opensafari --help
zsh: permission denied: opensafari

Fix

Append && chmod +x dist/cli/index.js to build:cli, matching the existing pattern already used by build:ax-bridge-cli and build:sim-hid-bridge-cli for their respective binaries.

Verification

  • rm -rf dist && npm run build:cli-rwxr-xr-x dist/cli/index.js
  • opensafari --version → prints 0.6.0

Test plan

  • Fresh build produces executable bin
  • opensafari --help works through the existing global npm link shim
  • No change to webpack config or runtime behavior

🤖 Generated with Claude Code

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]>
@shaun0927 shaun0927 merged commit 92834ac into develop Apr 27, 2026
2 checks passed
@shaun0927 shaun0927 deleted the fix/postbuild-chmod-cli branch April 27, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant