diff --git a/bash/.bashrc b/bash/.bashrc index 209a36f..2052da8 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -52,3 +52,23 @@ fi if [ "$TERM" == xterm ]; then export TERM=xterm-256color 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