Add support for config directories for bashrc

main
Buddy Sandidge 4 years ago
parent 79b798003e
commit 53d23a5f21

@ -52,3 +52,23 @@ fi
if [ "$TERM" == xterm ]; then if [ "$TERM" == xterm ]; then
export TERM=xterm-256color export TERM=xterm-256color
fi fi
if [ -d "${XDG_CONFIG_HOME}"/bash/bashrc.d ]; then
for file in "${XDG_CONFIG_HOME}"/bash/bashrc.d/*.sh; do
if [ -r "$file" ]; then
#shellcheck disable=1090
. "$file"
fi
done
fi
if [[ -d "${XDG_CONFIG_HOME}/bash/env.d" ]]; then
for file in "${XDG_CONFIG_HOME}"/bash/env.d/*.env; do
eval "$(
grep -v '^\s*\#' "${file}" |
grep -v '^\s*$' |
sed 's/^\s*export//g' |
sed 's/^/export /g'
)"
done
fi

Loading…
Cancel
Save