aboutsummaryrefslogtreecommitdiff
path: root/v2/src/development/getconf.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-04-04 12:10:54 -0300
committerEuAndreh <eu@euandre.org>2023-04-04 12:10:54 -0300
commitbf4a390c23a860ff8bda9538942f2b16cdcf8c05 (patch)
treeddc45415eeb7e8908605745294f58647fd18f533 /v2/src/development/getconf.sh
parentRevamp v2/ (diff)
downloadeuandre.org-bf4a390c23a860ff8bda9538942f2b16cdcf8c05.tar.gz
euandre.org-bf4a390c23a860ff8bda9538942f2b16cdcf8c05.tar.xz
Makefile: Add ShellCheck to "check" target
Diffstat (limited to '')
-rwxr-xr-xv2/src/development/getconf.sh14
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"/)"