feat: fallback to string value if config value is not json

This commit is contained in:
Andrew Thauer
2020-07-30 21:29:21 -04:00
parent fe4430907a
commit 0bd997d981
3 changed files with 54 additions and 9 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ function inject_config() {
with_entries(select(.key | startswith("APP_CONFIG_")) | .key |= sub("APP_CONFIG_"; "")) |
to_entries |
reduce .[] as $item (
{}; setpath($item.key | split("_"); $item.value | fromjson)
{}; setpath($item.key | split("_"); $item.value | try fromjson catch $item.value)
)')"
>&2 echo "Runtime app config: $config"