(input: string, branch?: string)
| 232 | } |
| 233 | |
| 234 | async function resolvePluginPath(input: string, branch?: string): Promise<ResolvedPluginPath> { |
| 235 | // Only treat as a local path if it explicitly looks like one |
| 236 | if (input.startsWith(".") || input.startsWith("/") || input.startsWith("~")) { |
| 237 | const expanded = expandHome(input) |
| 238 | const directPath = path.resolve(expanded) |
| 239 | if (await pathExists(directPath)) return { path: directPath } |
| 240 | throw new Error(`Local plugin path not found: ${directPath}`) |
| 241 | } |
| 242 | |
| 243 | // Skip bundled plugins when a branch is specified — the user wants a specific remote version |
| 244 | if (!branch) { |
| 245 | const bundledPluginPath = await resolveBundledPluginPath(input) |
| 246 | if (bundledPluginPath) { |
| 247 | return { path: bundledPluginPath } |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // Otherwise, fetch from GitHub (optionally from a specific branch) |
| 252 | return await resolveGitHubPluginPath(input, branch) |
| 253 | } |
| 254 | |
| 255 | function parseExtraTargets(value: unknown): string[] { |
| 256 | if (!value) return [] |
no test coverage detected