fix(extract-asar): hostFs.promises 补上 rename

atomicWriteFile/atomicCopyFile 需要 fsp.rename,hostFs.promises 原先漏了。
启动种子调 atomicWriteFile 第二步 rename 直接抛 TypeError: fsp.rename
is not a function,导致 /dsh-purge/apply 整条链路倒下。

跟 copyFile 一样走 fsForPair 路由,保证 src/dest 跨 asar/disk 边界时
用的是同一侧 fs。
This commit is contained in:
叫我小杨同学 committed 2026-10-09 12:28:07 +08:00
1 parent 19f5e26b84
commit 599c818c34
1 file changed
+1
+1
View File
@@ -83,6 +83,7 @@ export const hostFs = {
unlink: (p, ...args) => fsFor(p).promises.unlink(p, ...args),
rm: (p, ...args) => fsFor(p).promises.rm(p, ...args),
copyFile: (src, dest, ...args) => fsForPair(src, dest).promises.copyFile(src, dest, ...args),
rename: (src, dest, ...args) => fsForPair(src, dest).promises.rename(src, dest, ...args),
},
};
for (const method of HOST_SYNC) hostFs[method] = route(method, false);