summaryrefslogtreecommitdiff
path: root/src/lib/conf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/conf.sh')
-rw-r--r--src/lib/conf.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/conf.sh b/src/lib/conf.sh
index 8b855fe..ea4f15e 100644
--- a/src/lib/conf.sh
+++ b/src/lib/conf.sh
@@ -106,21 +106,24 @@ load_files() {
# If not, it prints a message saying to set them in the configuration file(s)
# for $slug.
check_vars() {
- local slug=$1
- shift
+ local slug=$1; shift
+
local ret=0
+
local VAR
for VAR in "$@"; do
if [[ -z ${!VAR:-} ]]; then
+ type print &>/dev/null || . libremessages
if [[ $(list_files $slug|wc -l) -gt 1 ]]; then
- echo "Configure '$VAR' in one of:"
+ print "Configure '%s' in one of:" "$VAR"
list_files $slug | sed 's/./ -> &/'
else
- echo "Configure '$VAR' in $(list_files $slug)"
+ print "Configure '%s' in '%s'" "$VAR" "$(list_files $slug)"
fi
ret=1
fi
done >&2
+
if [[ $ret != 0 ]]; then
return 1
fi