shell/common.sh: make loadall more reliable (and shell agnostic)

This commit is contained in:
Henrik Lissner 2016-12-16 18:33:18 -05:00
parent 1fe3bbeabf
commit efa692a819

View file

@ -12,8 +12,9 @@ fail() { printf "\r\033[2K[\033[0;31mFAIL\033[0m] $1\n"; echo; exit; }
load () { source "$DOTFILES/$1"; } load () { source "$DOTFILES/$1"; }
loadall () { loadall () {
for file in "$DOTFILES"/.enabled.d/${1//\//_}/${2:-*.*sh}; do local files=( "$ENABLED_DIR"/*/"${1:-*.*sh}" )
source "$file" for file in "${files[@]}"; do
[[ -e "$file" ]] && source "$file"
done done
} }