diff options
Diffstat (limited to 'v2/src/development/getconf.sh')
-rwxr-xr-x | v2/src/development/getconf.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/v2/src/development/getconf.sh b/v2/src/development/getconf.sh index dd623f7..4b615a8 100755 --- a/v2/src/development/getconf.sh +++ b/v2/src/development/getconf.sh @@ -74,7 +74,7 @@ escape() { } { - cat src/lib/base-conf | tee "$FILENAME".tmp + tee "$FILENAME".tmp < src/lib/base-conf DELIMITER=0 while read -r line; do if [ "$line" = '---' ]; then @@ -92,9 +92,11 @@ escape() { VALUE="$(printf '%s' "$line" | cut -d: -f2- | sed 's|^ ||' | escape)" printf '%s="%s"\n' "$KEY" "$VALUE" done < "$FILENAME" | tee -a "$FILENAME".tmp + # shellcheck source=/dev/null . "$FILENAME".tmp - cat src/lib/base."$lang".conf + cat src/lib/base."${lang:?}".conf + # shellcheck source=/dev/null . src/lib/base."$lang".conf title="${title:-"$site_name"}" @@ -105,10 +107,10 @@ escape() { printf 'filename="%s"\n' "$FILENAME" printf 'url_part="%s"\n' "$url_part" printf 'url="%s"\n' "$(url-for "$url_part" | absolute)" - printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "$date" +"$date_fmt" | escape)" - printf 'mailto_uri="%s%s"\n' "$mailto_uri_prefix" "$(uri "$title")" - printf 'discussions_url="%s%s"\n' "$discussions_url_prefix" "$(uri "$title")" - printf 'sourcecode_url="%s%s"\n' "$sourcecode_url_prefix" "$FILENAME" + printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "${date:?}" +"${date_fmt:?}" | escape)" + printf 'mailto_uri="%s%s"\n' "${mailto_uri_prefix:?}" "$(uri "$title")" + printf 'discussions_url="%s%s"\n' "${discussions_url_prefix:?}" "$(uri "$title")" + printf 'sourcecode_url="%s%s"\n' "${sourcecode_url_prefix:?}" "$FILENAME" printf 'lang_url="%s"\n' "$(url-for "$lang"/)" |