diff --git a/packages/cli/src/media-use/lib/manifest.mjs b/packages/cli/src/media-use/lib/manifest.mjs index 80bcedaef9..9c589289d8 100644 --- a/packages/cli/src/media-use/lib/manifest.mjs +++ b/packages/cli/src/media-use/lib/manifest.mjs @@ -118,8 +118,12 @@ export function replaceFile(path, content) { writeFileSync(temp, content, { flag: "wx" }); renameRidingWindowsHolds(temp, path); } catch (error) { - // EEXIST: the random name belongs to another writer, so it is left alone. - if (error?.code !== "EEXIST") rmSync(temp, { force: true }); + // EEXIST: the random name belongs to another writer, so it is left alone. A failed cleanup must not hide `error`. + if (error?.code !== "EEXIST") { + try { + rmSync(temp, { force: true }); + } catch {} + } throw error; } } diff --git a/skills-manifest.json b/skills-manifest.json index d0c713f70c..0e830cd27f 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -18,7 +18,7 @@ "files": 13 }, "media-use": { - "hash": "78085d6f3c4afd96", + "hash": "9c3e2f0be3c30add", "files": 131 }, "remotion-to-hyperframes": { diff --git a/skills/media-use/scripts/lib/manifest.mjs b/skills/media-use/scripts/lib/manifest.mjs index 80bcedaef9..9c589289d8 100644 --- a/skills/media-use/scripts/lib/manifest.mjs +++ b/skills/media-use/scripts/lib/manifest.mjs @@ -118,8 +118,12 @@ export function replaceFile(path, content) { writeFileSync(temp, content, { flag: "wx" }); renameRidingWindowsHolds(temp, path); } catch (error) { - // EEXIST: the random name belongs to another writer, so it is left alone. - if (error?.code !== "EEXIST") rmSync(temp, { force: true }); + // EEXIST: the random name belongs to another writer, so it is left alone. A failed cleanup must not hide `error`. + if (error?.code !== "EEXIST") { + try { + rmSync(temp, { force: true }); + } catch {} + } throw error; } }