From 887ac32aad71d7dd9861b03a8e55f73cee1b587c Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Thu, 27 May 2021 15:35:17 +0200
Subject: [PATCH] Warn on missing replacements; handle Ruby vars with single
 and double quotes

---
 bin/create_config.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/create_config.sh b/bin/create_config.sh
index 1d50c58..7aa0ade 100755
--- a/bin/create_config.sh
+++ b/bin/create_config.sh
@@ -93,7 +93,10 @@ cat $tplfile > $tmpfile
 # --- apply replace rules
 grep "^[a-zA-Z]" $replacefile | grep "=" | while read line
 do
-    key=$( echo $line | cut -f 2- -d ":" | cut -f 1 -d "=" ) 
+echo
+
+    key=$( echo $line | cut -f 1- -d "=")
+    echo $key | grep ":" >/dev/null && key=$( echo $key | rev | cut -f 1 -d ":" | rev )
     val=$( echo $line | cut -f 2- -d "=" )
 
     # Ruby erb template syntax to write a variable: <% @replace["mykey"] %>
-- 
GitLab