diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/conf.sh.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in index 0b2275a..63d5cf9 100644 --- a/src/lib/conf.sh.in +++ b/src/lib/conf.sh.in @@ -1,7 +1,7 @@ #!/hint/bash # This may be included with or without `set -euE` -# Copyright (C) 2012-2015 Luke Shumaker <lukeshu@sbcglobal.net> +# Copyright (C) 2012-2015, 2017 Luke Shumaker <lukeshu@sbcglobal.net> # # License: GNU GPLv2+ # @@ -19,7 +19,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. LIBREUSER="${SUDO_USER:-$USER}" -if [[ $LIBREUSER == $USER ]]; then +if [[ $LIBREUSER == "$USER" ]]; then LIBREHOME=$HOME else eval "LIBREHOME=~$LIBREUSER" @@ -112,19 +112,19 @@ load_files() { local file # Save the existing versions at _VARNAME - for var in $(list_envvars $slug); do + for var in $(list_envvars "$slug"); do [[ -n ${!var:-} ]] && eval "_$var=\${$var}" done # Load the files - for file in $(list_files $slug); do + for file in $(list_files "$slug"); do if [[ -r $file ]]; then . "$file" || return 1 fi done # Restore the _SAVED versions - for var in $(list_envvars $slug); do + for var in $(list_envvars "$slug"); do eval "$var=\${_$var:-\${$var:-}}" done } @@ -141,9 +141,9 @@ check_vars() { local VAR for VAR in "$@"; do if [[ -z ${!VAR:-} ]]; then - if [[ $(list_files $slug|wc -l) -gt 1 ]]; then + if [[ $(list_files "$slug"|wc -l) -gt 1 ]]; then libremessages _l print "Configure '%s' in one of:" "$VAR" - list_files $slug | sed 's/./ -> &/' + list_files "$slug" | sed 's/./ -> &/' else libremessages _l print "Configure '%s' in '%s'" "$VAR" "$(list_files "$slug")" fi |