fix: 解包失败时放回升级前的目录。

升级脚本先挪走旧目录后,解开中途失败会把那一份放回去。补丁没写完不清除升级标记,下次启动再试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-10-01 13:30:45 +08:00
1 parent 3ca5b1ec63
commit b47ebfb976
3 files changed
+26 -13

No files matched your search

+1 -1
View File
@@ -320,11 +320,11 @@ 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.clearUpgradeMarker(process.execPath);
officialUpdate.clearStaleExtractedApps(process.execPath);
log(config, "official upgrade reapplied; restarting onto the new build");
try {