mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
fix: show bun install instead of npm install in update notification when running under Bun (#714)
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
parent
0c135d0141
commit
5279bb92da
3 changed files with 11 additions and 6 deletions
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Show `bun install` instead of `npm install` in update notification when running under Bun
|
||||
### Added
|
||||
|
||||
- Edit tool now uses fuzzy matching as fallback when exact match fails, tolerating trailing whitespace, smart quotes, Unicode dashes, and special spaces
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ const __dirname = dirname(__filename);
|
|||
export const isBunBinary =
|
||||
import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN");
|
||||
|
||||
/** Detect if Bun is the runtime (compiled binary or bun run) */
|
||||
export const isBunRuntime = !!process.versions.bun;
|
||||
|
||||
// =============================================================================
|
||||
// Package Asset Paths (shipped with executable)
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import {
|
|||
visibleWidth,
|
||||
} from "@mariozechner/pi-tui";
|
||||
import { spawn, spawnSync } from "child_process";
|
||||
import { APP_NAME, getAuthPath, getDebugLogPath, isBunBinary, VERSION } from "../../config.js";
|
||||
import { APP_NAME, getAuthPath, getDebugLogPath, isBunBinary, isBunRuntime, VERSION } from "../../config.js";
|
||||
import type { AgentSession, AgentSessionEvent } from "../../core/agent-session.js";
|
||||
import type {
|
||||
ExtensionContext,
|
||||
|
|
@ -2330,11 +2330,10 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
showNewVersionNotification(newVersion: string): void {
|
||||
const updateInstruction = isBunBinary
|
||||
? theme.fg("muted", `New version ${newVersion} is available. Download from: `) +
|
||||
theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")
|
||||
: theme.fg("muted", `New version ${newVersion} is available. Run: `) +
|
||||
theme.fg("accent", "npm install -g @mariozechner/pi-coding-agent");
|
||||
const action = isBunBinary
|
||||
? `Download from: ${theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")}`
|
||||
: `Run: ${theme.fg("accent", `${isBunRuntime ? "bun" : "npm"} install -g @mariozechner/pi-coding-agent`)}`;
|
||||
const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
|
||||
|
||||
this.chatContainer.addChild(new Spacer(1));
|
||||
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue