mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-23 07:51:33 +00:00
fix(ci): resolve Claude marketplace shortcuts from OS home
This commit is contained in:
@@ -111,7 +111,9 @@ describe("marketplace plugins", () => {
|
||||
|
||||
it("resolves Claude-style plugin@marketplace shortcuts from known_marketplaces.json", async () => {
|
||||
await withTempDir(async (homeDir) => {
|
||||
const openClawHome = path.join(homeDir, "openclaw-home");
|
||||
await fs.mkdir(path.join(homeDir, ".claude", "plugins"), { recursive: true });
|
||||
await fs.mkdir(openClawHome, { recursive: true });
|
||||
await fs.writeFile(
|
||||
path.join(homeDir, ".claude", "plugins", "known_marketplaces.json"),
|
||||
JSON.stringify({
|
||||
@@ -127,7 +129,7 @@ describe("marketplace plugins", () => {
|
||||
|
||||
const { resolveMarketplaceInstallShortcut } = await import("./marketplace.js");
|
||||
const shortcut = await withEnvAsync(
|
||||
{ HOME: homeDir },
|
||||
{ HOME: homeDir, OPENCLAW_HOME: openClawHome },
|
||||
async () => await resolveMarketplaceInstallShortcut("superpowers@claude-plugins-official"),
|
||||
);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { resolveArchiveKind } from "../infra/archive.js";
|
||||
import { resolveOsHomeRelativePath } from "../infra/home-dir.js";
|
||||
import { runCommandWithTimeout } from "../process/exec.js";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
import { installPluginFromPath, type InstallPluginResult } from "./install.js";
|
||||
@@ -299,7 +300,7 @@ async function pathExists(target: string): Promise<boolean> {
|
||||
}
|
||||
|
||||
async function readClaudeKnownMarketplaces(): Promise<Record<string, KnownMarketplaceRecord>> {
|
||||
const knownPath = resolveUserPath(CLAUDE_KNOWN_MARKETPLACES_PATH);
|
||||
const knownPath = resolveOsHomeRelativePath(CLAUDE_KNOWN_MARKETPLACES_PATH);
|
||||
if (!(await pathExists(knownPath))) {
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user