refactor: Harden template rendering against formatter interference
This commit is contained in:
parent
afe7a7c815
commit
8fd860af5b
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue