From efa692a81964724234c9f03595e1e2504908d23c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 Dec 2016 18:33:18 -0500 Subject: [PATCH] shell/common.sh: make loadall more reliable (and shell agnostic) --- shell/common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/common.sh b/shell/common.sh index a77185d1..1e4fb962 100644 --- a/shell/common.sh +++ b/shell/common.sh @@ -12,8 +12,9 @@ fail() { printf "\r\033[2K[\033[0;31mFAIL\033[0m] $1\n"; echo; exit; } load () { source "$DOTFILES/$1"; } loadall () { - for file in "$DOTFILES"/.enabled.d/${1//\//_}/${2:-*.*sh}; do - source "$file" + local files=( "$ENABLED_DIR"/*/"${1:-*.*sh}" ) + for file in "${files[@]}"; do + [[ -e "$file" ]] && source "$file" done }