summaryrefslogtreecommitdiff
path: root/src/lib/conf.sh.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-20 16:39:29 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-20 22:48:28 -0400
commit2d1ae58285ade402260bf5d5a4dbf42aba027fc5 (patch)
tree87d8653c957e7ce3010fbe8aaab23d5e5ce4d764 /src/lib/conf.sh.in
parent243b4c911e10060ab11c1d759d4100c92cdda9d9 (diff)
Consistently use ". $(librelib slug)" to load libraries.
Diffstat (limited to 'src/lib/conf.sh.in')
-rw-r--r--src/lib/conf.sh.in9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index 8394801..0b2275a 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -133,7 +133,7 @@ load_files() {
# Check whether the variables listed are properly set.
# If not, it prints a message saying to set them in the configuration file(s)
# for $slug.
-check_vars() (
+check_vars() {
local slug=$1; shift
local ret=0
@@ -141,12 +141,11 @@ check_vars() (
local VAR
for VAR in "$@"; do
if [[ -z ${!VAR:-} ]]; then
- type print &>/dev/null || . libremessages
if [[ $(list_files $slug|wc -l) -gt 1 ]]; then
- _l print "Configure '%s' in one of:" "$VAR"
+ libremessages _l print "Configure '%s' in one of:" "$VAR"
list_files $slug | sed 's/./ -> &/'
else
- _l print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)"
+ libremessages _l print "Configure '%s' in '%s'" "$VAR" "$(list_files "$slug")"
fi
ret=1
fi
@@ -155,7 +154,7 @@ check_vars() (
if [[ $ret != 0 ]]; then
return 1
fi
-)
+}
# Usage: get_var <slug> <var_name> <default_value>
# Does not work with arrays