diff --git a/src/marketplace.test.ts b/src/marketplace.test.ts index 933f663..c5d40ce 100644 --- a/src/marketplace.test.ts +++ b/src/marketplace.test.ts @@ -419,4 +419,23 @@ describe("marketplace", () => { expect(calls).toEqual([["git", "-C", alphaLocation, "pull"]]); expect(messages).toContain("Updated 1 marketplace(s)"); }); + + test("updateAllMarketplaces() prints message when no GitHub marketplaces found", async () => { + writeKnownMarketplaces({ + local: { + source: { source: "directory", path: "/some/path" }, + installLocation: "/some/path", + lastUpdated: "2025-01-01T00:00:00.000Z", + }, + }); + + const { messages, restore } = captureConsole("log"); + try { + await updateAllMarketplaces(paths); + } finally { + restore(); + } + + expect(messages).toContain("No marketplaces to update."); + }); }); diff --git a/src/marketplace.ts b/src/marketplace.ts index c1844d4..fcb51dc 100644 --- a/src/marketplace.ts +++ b/src/marketplace.ts @@ -256,6 +256,11 @@ export async function updateAllMarketplaces( ([, info]) => info.source.source === "github", ); + if (githubMarketplaces.length === 0) { + console.log("No marketplaces to update."); + return; + } + for (const [name] of githubMarketplaces) { await updateMarketplace(name, paths); }