fix: patch broken windows install (#434)
This commit is contained in:
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -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) }}
|
||||
|
||||
8
build.js
8
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user