diff --git a/lib/scaffold.sh b/lib/scaffold.sh index b9dc437..8c1e3a7 100644 --- a/lib/scaffold.sh +++ b/lib/scaffold.sh @@ -16,6 +16,12 @@ render_template() { local content content=$(<"$template_file") + # HARDENING: collapse any “spaced” placeholders from a formatter + # { { KEY } } -> {{KEY}} (KEY = UPPERCASE/underscore) + # Defense in depth: if Prettier or a copy-paste breaks the syntax again, + # the scaffold fixes itself. sed is a core utility (like tr/date already used here). + content=$(sed -E 's/\{[[:space:]]*\{[[:space:]]*([A-Z_]+)[[:space:]]*\}[[:space:]]*\}/{{\1}}/g' <<<"$content") + # Defaults (:-) so master-repo templates render even when GENOME_* are unset # (scaffold_master runs before any genome; set -u would otherwise abort here). local genome_name_upper