diff options
| author | 2024-09-26 14:25:59 +0500 | |
|---|---|---|
| committer | 2024-09-26 14:25:59 +0500 | |
| commit | b4e6bb5840ebb4fd820f5dc2ac4567a80c47354a (patch) | |
| tree | 558aedbf503093784ae853630fb278a83a588344 | |
| parent | adcbf03e7fbaa725fd978f5fc78312d2ba61a798 (diff) | |
update builder.sh
| -rwxr-xr-x | builder.sh | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |
