mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:20:22 +08:00
fix: #13 按 npm/yarn/pnpm 实际布局找插件根,无效 DSH_BASE 写明原因
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2a1d37c97a
commit
76d86fafb1
3 files changed
+210
-10
No files matched your search
+4
-4
@@ -56,7 +56,7 @@ function renderStatus(state) {
|
||||
out.push(` ${fsExists(fp) ? "✓" : "✗"} ${key.padEnd(22)} ${fp}`);
|
||||
}
|
||||
} else {
|
||||
out.push(line("插件根 / plugin root", "NOT FOUND (set DSH_BASE)", false));
|
||||
out.push(line("插件根 / plugin root", core.missingAiBaseMessage(), false));
|
||||
}
|
||||
out.push(line("shim 目录", state.shim_dir || "未定位 / not found", !!state.shim_dir));
|
||||
if (state.desktop_runtimes?.length) {
|
||||
@@ -258,7 +258,7 @@ async function handlePurgeCommand(rawInput, config) {
|
||||
const scrubbed = core.sanitizeDesktopCommandRuntimes();
|
||||
const state = await core.gatherState();
|
||||
if (!state.ai_base) {
|
||||
return { kind: "error", text: "插件根未找到 / plugin root NOT FOUND — 请设置 DSH_BASE" };
|
||||
return { kind: "error", text: core.missingAiBaseMessage() };
|
||||
}
|
||||
await core.backupAll(state.ai_base);
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
@@ -538,7 +538,7 @@ export function apply(ctx, config) {
|
||||
core.applyRuntimeEnv();
|
||||
const scrubbed = core.sanitizeDesktopCommandRuntimes();
|
||||
const state = await core.gatherState();
|
||||
if (!state.ai_base) return { text: "ERROR: 插件根未找到 / set DSH_BASE" };
|
||||
if (!state.ai_base) return { text: "ERROR: " + core.missingAiBaseMessage() };
|
||||
await core.backupAll(state.ai_base);
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
await core.installOverride(state.dsh_home, false);
|
||||
@@ -707,7 +707,7 @@ function installWebServer(ctx, cfg) {
|
||||
const scrubbed = core.sanitizeDesktopCommandRuntimes();
|
||||
const state = await core.gatherState();
|
||||
if (!state.ai_base) {
|
||||
sendJson(response, 500, { ok: false, error: "插件根未找到 / set DSH_BASE" });
|
||||
sendJson(response, 500, { ok: false, error: core.missingAiBaseMessage() });
|
||||
return;
|
||||
}
|
||||
await core.backupAll(state.ai_base);
|
||||
|
||||
Reference in new issue
Block a user