aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Alexey Stepanov <blueingreen@bluig.space>2024-09-26 14:25:59 +0500
committerLibravatar Alexey Stepanov <blueingreen@bluig.space>2024-09-26 14:25:59 +0500
commitb4e6bb5840ebb4fd820f5dc2ac4567a80c47354a (patch)
tree558aedbf503093784ae853630fb278a83a588344
parentadcbf03e7fbaa725fd978f5fc78312d2ba61a798 (diff)
update builder.sh
-rwxr-xr-xbuilder.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/builder.sh b/builder.sh
index d450860..27aacfc 100755
--- a/builder.sh
+++ b/builder.sh
@@ -2,7 +2,9 @@
declare -g configFile="./templates/config.yaml"
declare -g fileName
+declare -g headFileTemplate="./templates/head.mustache"
declare -g headJson
+declare -g bodyFileTemplate="./templates/body.mustache"
declare -g bodyJson
declare -g tmpBodyJson
@@ -30,7 +32,7 @@ declare -g tokenDecG
declare -g tokenDecB
readarray -t schemesFiles < <(find "$schemesPath" -type f -iname '*.yaml')
-readarray -t necessaryTokensPaletteList < <(grep -oP '\{\{\K[^}]+(?=\}\})' ./templates/body.mustache | awk -F'.' '{print $1}' | sort -u)
+readarray -t necessaryTokensPaletteList < <(grep -oP '\{\{\K[^}]+(?=\}\})' "$bodyFileTemplate" | awk -F'.' '{print $1}' | sort -u)
function getProperty() {
yq -oy "$schemeFile" | yq -o=json -r ".$1"
@@ -136,10 +138,10 @@ for schemeFile in "${schemesFiles[@]}"; do
createFile
- lustache-cli -i ./templates/head.mustache --json-data "$headJson" >./"$fileName"
+ lustache-cli -i "$headFileTemplate" --json-data "$headJson" >./"$fileName"
echo >>./"$fileName"
- lustache-cli -i ./templates/body.mustache --json-data "$bodyJson" >>./"$fileName"
+ lustache-cli -i "$bodyFileTemplate" --json-data "$bodyJson" >>./"$fileName"
done