From 45d41c233e951c993745e3d11a0410202a64fed8 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 4 Oct 2024 18:41:22 +0200 Subject: fix(common/init): Correctly handle quoted values in the `replacement_file` --- common/init | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/init b/common/init index 8d8a2d0..d2eb028 100644 --- a/common/init +++ b/common/init @@ -172,8 +172,9 @@ rm --recursive ./git_template while read -r var; do var_name="${var%=*}" - var_value="${var#*=\"}" - var_value="${var_value%\"}" + var_value="${var#*=}" + # The `eval` _should_ be safe, as all values are quoted correctly. + var_value="$(eval echo "$var_value")" fd . --hidden --type file --exec sed --in-place "s|%\bINIT_$var_name\b|$var_value|g" -- cgit 1.4.1