From 9b4629bddd704faf6a6ae861f6328904c62c3cb9 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 27 May 2021 15:20:36 +0200 Subject: [PATCH] Warn on missing replacements; handle Ruby vars with single and double quotes --- bin/create_config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/create_config.sh b/bin/create_config.sh index 511b477..1d50c58 100755 --- a/bin/create_config.sh +++ b/bin/create_config.sh @@ -98,7 +98,7 @@ do # Ruby erb template syntax to write a variable: <% @replace["mykey"] %> # Here are 2 regex to handle single and double quotes - regex1="<\%\=\ *\@replace\[\'$key\'\]\ *\%>" + regex1="<\%\=\ *\@replace\['$key'\]\ *\%>" regex2="<\%\=\ *\@replace\[\"$key\"\]\ *\%>" # Show a warning if both regex do not match @@ -132,6 +132,7 @@ if [ $? -ne 0 ]; then exit 4 fi +echo echo --- Check missing replacements grep '<\%\=\ *\@replace\[' ${outfile} >/dev/null if [ $? -eq 0 ]; then -- GitLab