fix(cli): probe bun.exe under BUN_INSTALL on Windows

isBunInstalled() spawned <BUN_INSTALL>/bin/bun, which does not exist on
Windows where the installer ships bun.exe. spawnSync adds no extension to
an explicit path, so the probe failed and the CLI quietly started the
server under Node even with Bun installed. The probe now names bun.exe
on win32.

Claude-Session: https://claude.ai/code/session_01VqV56Hez25hTxXH4ipJfzH
This commit is contained in:
Bohdan Triapitsyn
2026-09-05 14:46:06 +03:00
parent 65019492e5
commit 9eb8a92169
+4 -1
View File
@@ -117,7 +117,10 @@ function getBunBinary() {
return process.env.BUN_BINARY.trim();
}
if (typeof process.env.BUN_INSTALL === 'string' && process.env.BUN_INSTALL.trim().length > 0) {
return path.join(process.env.BUN_INSTALL.trim(), 'bin', 'bun');
// The Windows installer places bun.exe there; spawnSync does not append
// the extension to an explicit path, so without it the probe fails and
// the CLI silently falls back to Node.
return path.join(process.env.BUN_INSTALL.trim(), 'bin', process.platform === 'win32' ? 'bun.exe' : 'bun');
}
return 'bun';
}