mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 08:50:22 +08:00
feat: 发布 1.1.20,官方桌面升级安装已下载的新版本
对准 dsh 0.1.7-rc.2,并保留 0.1.7-rc.1 的旧锚点。安装目录不写死盘符。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fd8d47c00f
commit
978538f0ae
11 files changed
+494
-29
No files matched your search
@@ -6,6 +6,7 @@ import * as rules from "./rules.js";
|
||||
import * as skills from "./skills.js";
|
||||
import * as updater from "./update.js";
|
||||
import * as reapply from "./reapply.js";
|
||||
import * as officialUpdate from "./official-update.js";
|
||||
import {
|
||||
GLOBAL_PROMPT_ORDER,
|
||||
isMnemonPluginMessage,
|
||||
@@ -272,6 +273,23 @@ function shimNeedsPatch(state) {
|
||||
}
|
||||
|
||||
async function settleInstalledPatches(config, ctx) {
|
||||
if (officialUpdate.upgradeMarkerExists(process.execPath)) {
|
||||
const upgraded = await reapply.reapplyInstalled({ scheduleSwap: false, forceExtract: true });
|
||||
officialUpdate.clearUpgradeMarker(process.execPath);
|
||||
if (!upgraded.ok) {
|
||||
log(config, "official upgrade reapply failed:", upgraded.error || "");
|
||||
return "reapply-failed";
|
||||
}
|
||||
officialUpdate.clearStaleExtractedApps(process.execPath);
|
||||
log(config, "official upgrade reapplied; restarting onto the new build");
|
||||
try {
|
||||
hostctl.scheduleRestart(null, ctx);
|
||||
} catch (e) {
|
||||
log(config, "restart after official upgrade failed:", String(e && e.message ? e.message : e));
|
||||
return "restart-failed";
|
||||
}
|
||||
return "restarting";
|
||||
}
|
||||
if (!reapply.patchesMatchInstall()) {
|
||||
const result = await reapply.reapplyInstalled();
|
||||
if (!result.ok) {
|
||||
|
||||
Reference in new issue
Block a user