feat: offer local plugin install in git checkouts

This commit is contained in:
Peter Steinberger
2026-01-15 09:07:14 +00:00
parent e0f69a2294
commit 5599603bdb
4 changed files with 51 additions and 10 deletions

View File

@@ -79,7 +79,10 @@ describe("ensureOnboardingPluginInstalled", () => {
select: vi.fn(async () => "local") as WizardPrompter["select"],
});
const cfg: ClawdbotConfig = {};
vi.mocked(fs.existsSync).mockReturnValue(true);
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return raw.endsWith(`${path.sep}.git`) || raw.endsWith(`${path.sep}extensions${path.sep}zalo`);
});
const result = await ensureOnboardingPluginInstalled({
cfg,
@@ -104,7 +107,10 @@ describe("ensureOnboardingPluginInstalled", () => {
confirm,
});
const cfg: ClawdbotConfig = {};
vi.mocked(fs.existsSync).mockReturnValue(true);
vi.mocked(fs.existsSync).mockImplementation((value) => {
const raw = String(value);
return raw.endsWith(`${path.sep}.git`) || raw.endsWith(`${path.sep}extensions${path.sep}zalo`);
});
installPluginFromNpmSpec.mockResolvedValue({
ok: false,
error: "nope",