fix(cli): detect Bun on Windows in launcher (which → where)#131
Open
Trypd wants to merge 1 commit into
Open
Conversation
findBun() used `which bun`, which is POSIX-only, so on Windows the PATH lookup throws and falls through to Unix-only candidate paths ($HOME/.bun/bin/bun, /usr/local/bin, /opt/homebrew). HOME is also usually unset on Windows. Result: even with Bun installed and on PATH, the launcher reports "Bun runtime not found". - Use `where bun` on win32, `which bun` elsewhere; take first line. - Fall back to %USERPROFILE%\.bun\bin\bun.exe (HOME || USERPROFILE). - Make the install hint platform-aware (PowerShell one-liner on Windows).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows,
claudishfails to launch even when Bun is installed and onPATH:bin/claudish.cjsfindBun()is POSIX-only:execSync("which bun")—whichdoesn't exist in cmd/PowerShell, so the lookup throws.$HOME/.bun/bin/bun,/usr/local/bin/bun,/opt/homebrew/bin/bun) — none match the Windows install location%USERPROFILE%\.bun\bin\bun.exe.process.env.HOMEis typically unset on Windows (it'sUSERPROFILE), so even the first candidate resolves toundefined/.bun/bin/bun.Net effect: a correctly installed Bun is reported as missing on every Windows machine.
Fix
where bunonwin32,which bunelsewhere; take the first returned line.%USERPROFILE%\.bun\bin\bun.exe(and extensionless), usingHOME || USERPROFILE.irm bun.sh/install.ps1 | iex) instead ofcurl … | bash.No behavior change on macOS/Linux (same
whichpath and same Unix candidates).Testing
claudish --version→claudish version 7.1.2(was failing before).node --check bin/claudish.cjspasses.