Skip to content

Commit 261b8bf

Browse files
huanghekaryhe1019
andauthored
build: restore +x on dist/src/main.js after tsc rebuild (#1644)
clean-dist deletes dist/ and tsc --build re-emits files without preserving the executable bit on the bin entry. Symlinked global install then hits EACCES on spawn until manually chmod'd. Chain a chmodSync into the existing prebuild-manifest hook so any future rebuild self-heals. node -e instead of bare `chmod +x` to keep the script portable (npm runs on Windows via Git Bash where chmod is a no-op, but fs.chmodSync still silently no-ops there too — no extra branching needed). Co-authored-by: Kary <karyhe1019@gmail.com>
1 parent 1e7ebe7 commit 261b8bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"dev": "tsx src/main.ts",
4343
"dev:bun": "bun src/main.ts",
4444
"build": "npm run clean-dist && npm run copy-yaml && npm run build-manifest",
45-
"prebuild-manifest": "tsc --build",
45+
"prebuild-manifest": "tsc --build && node -e \"require('fs').chmodSync('dist/src/main.js', 0o755)\"",
4646
"build-manifest": "tsx src/build-manifest.ts",
4747
"clean-dist": "node scripts/clean-dist.cjs",
4848
"copy-yaml": "node scripts/copy-yaml.cjs",

0 commit comments

Comments
 (0)