fix: clean runtime deps backup owner marker

This commit is contained in:
Peter Steinberger
2026-04-27 08:43:01 +01:00
parent bfdee5fa72
commit 84929bf85b
2 changed files with 2 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ function replaceDirAtomically(targetPath, sourcePath) {
} catch (error) {
if (movedExistingTarget && !fs.existsSync(targetPath) && fs.existsSync(backupPath)) {
fs.renameSync(backupPath, targetPath);
removePathIfExists(path.join(targetPath, TEMP_OWNER_FILE));
}
throw error;
}

View File

@@ -392,6 +392,7 @@ describe("stageBundledPluginRuntimeDeps", () => {
).toThrow("rename failed after backup");
expect(fs.readFileSync(path.join(targetPath, "marker.txt"), "utf8")).toBe("original\n");
expect(fs.existsSync(path.join(targetPath, "owner.json"))).toBe(false);
});
it("restages when installed root runtime dependency contents change", () => {