feat(coding-agent): Add built-in update command (#3680)

This commit is contained in:
Armin Ronacher
2026-04-25 13:09:33 +02:00
committed by GitHub
parent 0b271a2c4f
commit dcf2651631
7 changed files with 372 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
import { afterEach, describe, expect, test } from "vitest";
import { detectInstallMethod, getUpdateInstruction } from "../src/config.js";
import { detectInstallMethod, getSelfUpdateCommand, getUpdateInstruction } from "../src/config.js";
const execPathDescriptor = Object.getOwnPropertyDescriptor(process, "execPath");
@@ -27,4 +27,14 @@ describe("detectInstallMethod", () => {
"Run: pnpm install -g @mariozechner/pi-coding-agent",
);
});
test("does not self-update unknown wrapper installs", () => {
setExecPath("/usr/local/bin/node");
expect(detectInstallMethod()).toBe("unknown");
expect(getSelfUpdateCommand("@mariozechner/pi-coding-agent")).toBeUndefined();
expect(getUpdateInstruction("@mariozechner/pi-coding-agent")).toBe(
"Update @mariozechner/pi-coding-agent using the package manager, wrapper, or source checkout that provides this installation.",
);
});
});