From dc850c350ff449dca7df79757912853b544a9de8 Mon Sep 17 00:00:00 2001 From: Sven Date: Sun, 22 Mar 2026 20:13:48 +0100 Subject: [PATCH] fix(patches): update repost-commentary patch to detect native fork implementation Fix D's old snippet (the bare `} else {` content block) still matched after the fork absorbed the repost-commentary changes natively, causing a duplicate `} else if (postType === "repost") {` block to be inserted on every deploy and preventing startup. Added NATIVE_MARKER check for the fork's own repost branch so the patch skips cleanly when the changes are already present. Co-Authored-By: Claude Sonnet 4.6 --- scripts/patch-ap-repost-commentary.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/patch-ap-repost-commentary.mjs b/scripts/patch-ap-repost-commentary.mjs index b8881c0a..bdfb779d 100644 --- a/scripts/patch-ap-repost-commentary.mjs +++ b/scripts/patch-ap-repost-commentary.mjs @@ -34,6 +34,8 @@ const candidates = [ ]; const MARKER = "// repost-commentary fix"; +// Also present when the fork has this change baked in natively (no comment marker needed) +const NATIVE_MARKER = '} else if (postType === "repost") {'; // --------------------------------------------------------------------------- // Fix A – jf2ToActivityStreams(): add commentary variable before the return @@ -123,7 +125,7 @@ for (const filePath of candidates) { checked += 1; let source = await readFile(filePath, "utf8"); - if (source.includes(MARKER)) { + if (source.includes(MARKER) || source.includes(NATIVE_MARKER)) { console.log(`[postinstall] patch-ap-repost-commentary: already applied to ${filePath}`); continue; }