Fix bunx availability check on windows (#96)

This commit is contained in:
Howard Zhang authored and GitHub committed 2025-10-04 18:16:57 -04:00
1 parent 055bf22308
commit 1ad9304039
2 files changed
+5 -3

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@
],
"scripts": {
"start": "bun run src/ccstatusline.ts",
"build": "rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
"build": "rm -rf dist/* ; bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
"postbuild": "bun run scripts/replace-version.ts",
"example": "cat scripts/payload.example.json | bun start",
"prepublishOnly": "bun run build",
@@ -70,4 +70,4 @@
"patchedDependencies": {
"ink@6.2.0": "patches/ink@6.2.0.patch"
}
}
}
+3 -1
View File
@@ -43,7 +43,9 @@ export async function isInstalled(): Promise<boolean> {
export function isBunxAvailable(): boolean {
try {
execSync('which bunx', { stdio: 'ignore' });
// Use platform-appropriate command to check for bunx availability
const command = process.platform === 'win32' ? 'where bunx' : 'which bunx';
execSync(command, { stdio: 'ignore' });
return true;
} catch {
return false;