mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 13:00:22 +08:00
fix: 发布 1.1.49-beta.1,修 macOS 官方桌面重启假失败与解包后 CLI 失效(#53)。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
9fa474cc36
commit
94a7cf814e
9 files changed
+426
-44
No files matched your search
+19
-2
@@ -109,7 +109,15 @@ function watchWebTreeReady(ctx) {
|
||||
}
|
||||
|
||||
function fsExists(fp) {
|
||||
return fsFor(fp).existsSync(fp);
|
||||
const list = Array.isArray(fp) ? fp : [fp];
|
||||
return list.some((p) => {
|
||||
if (!p || typeof p !== "string") return false;
|
||||
try {
|
||||
return fsFor(p).existsSync(p);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function line(title, value, ok = null) {
|
||||
@@ -126,7 +134,9 @@ function renderStatus(state) {
|
||||
if (state.ai_base) {
|
||||
out.push(line("插件根 / plugin root", state.ai_base));
|
||||
for (const [key, fp] of Object.entries(state.files)) {
|
||||
out.push(` ${fsExists(fp) ? "✓" : "✗"} ${key.padEnd(22)} ${fp}`);
|
||||
const list = Array.isArray(fp) ? fp : [fp];
|
||||
const shown = list.length <= 1 ? String(list[0] || "") : `${list[0]} (+${list.length - 1})`;
|
||||
out.push(` ${fsExists(fp) ? "✓" : "✗"} ${key.padEnd(22)} ${shown}`);
|
||||
}
|
||||
} else {
|
||||
out.push(line("插件根 / plugin root", core.missingAiBaseMessage(), false));
|
||||
@@ -1352,6 +1362,12 @@ function installWebServer(ctx, cfg) {
|
||||
const report = await core.applyPatches(state.ai_base);
|
||||
const override = await core.readOverrideForUi(state.dsh_home);
|
||||
const shim = await core.patchAllShims();
|
||||
let cliRepair = null;
|
||||
try {
|
||||
cliRepair = core.repairOfficialCliAfterUnpack();
|
||||
} catch (e) {
|
||||
cliRepair = { ok: false, error: String(e && e.message ? e.message : e) };
|
||||
}
|
||||
const flash = core.silenceCmdFlash(state.ai_base);
|
||||
const summary = core.summarizeApplyReport(report);
|
||||
const complete = summary.failed.length === 0 && flash.ok === true;
|
||||
@@ -1396,6 +1412,7 @@ function installWebServer(ctx, cfg) {
|
||||
override_installed: override.installed,
|
||||
shim,
|
||||
desktop_scrubbed: scrubbed,
|
||||
cli_repair: cliRepair,
|
||||
cmd_flash: flash,
|
||||
});
|
||||
if (shouldRestart && handoff && core.desktopAsarStillSealed()) {
|
||||
|
||||
Reference in new issue
Block a user