diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b458c7a..a73c991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,24 @@ jobs: echo "✓ Bundle size is acceptable" fi + # Test npm install flow with native shell to catch shebang issues + # This uses PowerShell on Windows (not Git Bash) to match real user experience + - name: Test npm install flow (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + npm pack + npm install -g (Get-Item letta-ai-letta-code-*.tgz).FullName + letta --help + + - name: Test npm install flow (Unix) + if: runner.os != 'Windows' + shell: sh + run: | + npm pack + npm install -g ./letta-ai-letta-code-*.tgz + letta --help + - name: Headless smoke test (API) # Only run on push to main or PRs from the same repo (not forks, to protect secrets) if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} diff --git a/build.js b/build.js index fff795d..b68a06c 100644 --- a/build.js +++ b/build.js @@ -55,13 +55,7 @@ content = content.replace( `globalThis.Bun.secrets`, ); -/** - * Polyglot shebang - * Prefer bun, fallback to node - * ref: https://sambal.org/2014/02/passing-options-node-shebang-line/ - */ -const withShebang = `#!/bin/sh -":" //#; exec /usr/bin/env sh -c 'command -v bun >/dev/null && exec bun "$0" "$@" || exec node "$0" "$@"' "$0" "$@" +const withShebang = `#!/usr/bin/env node ${content}`; await Bun.write(outputPath, withShebang);