fix: 发布 1.1.24,修源码版桌面误判与 apps/cli 误写(#40 / #41)

pathLooksDesktop 需安装形态才判桌面;源码 apps/cli 跳过 hide-console;revertAll 无 bak 只跳过不删。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-09-27 23:45:32 +08:00
1 parent 16fb3ff634
commit d31894a931
6 files changed
+141 -8

No files matched your search

+7 -2
View File
@@ -313,12 +313,13 @@ export function silenceCmdFlash(aiBase = findAiBase()) {
const customBash = silenceLiangshenCustomBashFlash();
const phase1 = silenceLiangshenPhase1Strip();
const mnemon = silenceMnemonGitFlash();
// bin.js 写失败(missing_bin / ACL)不阻断 Apply。
// bin.js 写失败(missing_bin / ACL)不阻断 Apply。源码 cli 跳过注入也算成功(#41)。
const ok =
process.platform !== "win32" ||
hide.entry === "injected" ||
hide.entry === "already_injected" ||
hide.entry === "skipped_not_win32" ||
hide.entry === "skipped_source_cli" ||
hide.entry === "missing_bin" ||
hide.entry === "sealed_asar" ||
(typeof hide.entry === "string" && hide.entry.startsWith("error:"));
@@ -4020,6 +4021,7 @@ export async function backupAll(aiBase) {
export async function revertAll(aiBase) {
const files = targetFiles(aiBase);
const reverted = [];
const skipped = [];
const errors = [];
for (const fp of flattenTargetPaths(files)) {
const bak = fp + ".dshpurge.bak";
@@ -4031,9 +4033,12 @@ export async function revertAll(aiBase) {
} catch (e) {
errors.push([fp, String(e)]);
}
continue;
}
// 没有 bak 时绝不删除目标。源码部署的构建产物缺备份时,删了无法自愈(#41)。
if (fs.existsSync(fp)) skipped.push(fp);
}
return { reverted, errors };
return { reverted, skipped, errors };
}
export async function hasBackup(aiBase) {