From f00c2902042c1e82e0c7b376405ea876fa73be11 Mon Sep 17 00:00:00 2001 From: weishu Date: Sun, 18 Jan 2026 12:27:43 +0800 Subject: [PATCH] fix: add postinstall script to set bin/hapi.cjs executable permission (#78) This fixes an issue where npx @twsxtd/hapi fails because npm doesn't create bin symlinks for packages with optionalDependencies. The postinstall script ensures bin/hapi.cjs has executable permission. --- cli/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/package.json b/cli/package.json index 66c704c5..e99aa104 100644 --- a/cli/package.json +++ b/cli/package.json @@ -33,6 +33,7 @@ "@twsxtd/hapi-win32-x64": "0.9.0" }, "scripts": { + "postinstall": "node -e \"try{require('fs').chmodSync(require('path').join(__dirname,'bin','hapi.cjs'),0o755)}catch(e){}\"", "typecheck": "tsc --noEmit", "build:exe": "bun run scripts/build-executable.ts", "build:exe:all": "bun run scripts/build-executable.ts --all",