From a55626c9f1af5d4da14ddc368a5fb216f0e9895c Mon Sep 17 00:00:00 2001 From: Gor Grigoryan <150702073+gor-st@users.noreply.github.com> Date: Wed, 24 Dec 2025 18:52:07 +0400 Subject: [PATCH] support hidden folders --- base-action/src/install-plugins.ts | 7 ++++++- base-action/test/install-plugins.test.ts | 26 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/base-action/src/install-plugins.ts b/base-action/src/install-plugins.ts index 0eb12e7..7d09d89 100644 --- a/base-action/src/install-plugins.ts +++ b/base-action/src/install-plugins.ts @@ -13,11 +13,16 @@ const MARKETPLACE_URL_REGEX = * @returns true if the input is a local path, false if it's a URL */ function isLocalPath(input: string): boolean { - // Local paths start with ./, ../, /, or a drive letter (Windows) + // Local paths start with: + // - ./ or ../ (relative paths) + // - / (Unix absolute paths) + // - .something/ (hidden folders like .claude-marketplace/) + // - Drive letter (Windows paths like C:\) return ( input.startsWith("./") || input.startsWith("../") || input.startsWith("/") || + /^\.[a-zA-Z0-9_-]+[\\\/]/.test(input) || // Hidden folders: .plugins/, .cache/ /^[a-zA-Z]:[\\\/]/.test(input) ); } diff --git a/base-action/test/install-plugins.test.ts b/base-action/test/install-plugins.test.ts index 7b0ab28..339fb45 100644 --- a/base-action/test/install-plugins.test.ts +++ b/base-action/test/install-plugins.test.ts @@ -703,4 +703,30 @@ describe("installPlugins", () => { { stdio: "inherit" }, ); }); + + test("should accept hidden folder path (.folder-name/)", async () => { + const spy = createMockSpawn(); + await installPlugins(".my-plugins/marketplace", "test-plugin"); + + expect(spy).toHaveBeenCalledTimes(2); + expect(spy).toHaveBeenNthCalledWith( + 1, + "claude", + ["plugin", "marketplace", "add", ".my-plugins/marketplace"], + { stdio: "inherit" }, + ); + }); + + test("should accept hidden folder path with Windows backslash", async () => { + const spy = createMockSpawn(); + await installPlugins(".hidden-folder\\marketplace", "test-plugin"); + + expect(spy).toHaveBeenCalledTimes(2); + expect(spy).toHaveBeenNthCalledWith( + 1, + "claude", + ["plugin", "marketplace", "add", ".hidden-folder\\marketplace"], + { stdio: "inherit" }, + ); + }); });