From 84929bf85b0b29d72aea3e085f52a940c79fa8da Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 08:43:01 +0100 Subject: [PATCH] fix: clean runtime deps backup owner marker --- scripts/stage-bundled-plugin-runtime-deps.mjs | 1 + test/scripts/stage-bundled-plugin-runtime-deps.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/stage-bundled-plugin-runtime-deps.mjs b/scripts/stage-bundled-plugin-runtime-deps.mjs index df5bdc8fa5a..2b9507253f5 100644 --- a/scripts/stage-bundled-plugin-runtime-deps.mjs +++ b/scripts/stage-bundled-plugin-runtime-deps.mjs @@ -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; } diff --git a/test/scripts/stage-bundled-plugin-runtime-deps.test.ts b/test/scripts/stage-bundled-plugin-runtime-deps.test.ts index fa543db54d1..db08f95df44 100644 --- a/test/scripts/stage-bundled-plugin-runtime-deps.test.ts +++ b/test/scripts/stage-bundled-plugin-runtime-deps.test.ts @@ -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", () => {