export DOTFILES=$(cd "$(dirname "$HOME/$(readlink $HOME/.zshenv)")" && cd .. && pwd)
|
|
source "$DOTFILES/helpers"
|
|
|
|
cleanup_helpers
|
|
|
|
# Load env files
|
|
for file in $DOTFILES/*/env.sh; do
|
|
if [[ "$(basename $(dirname $file))" != "zsh" ]]; then
|
|
source "$file"
|
|
fi
|
|
done
|
|
|
|
# Load additional sh files
|
|
for file in $DOTFILES/*/*.sh; do
|
|
if [[ "$(basename $file)" != env.sh ]] && [[ "$(basename $(dirname $file))" != "zsh" ]]; then
|
|
source "$file"
|
|
fi
|
|
done
|
|
|
|
# Set up prompt
|
|
function _prompt_command() {
|
|
local retval=$?
|
|
local green="\[$(tput setaf 2)\]"
|
|
local blue="\[$(tput setaf 4)\]"
|
|
local reset="\[$(tput sgr0)\]"
|
|
PS1=""
|
|
if [[ $retval -ne 0 ]]; then
|
|
local red="\[$(tput setaf 1)\]"
|
|
PS1+="$red$retval$reset "
|
|
fi
|
|
PS1+="$green\u$reset "
|
|
PS1+="$blue\W$reset $ "
|
|
}
|
|
export PROMPT_COMMAND=_prompt_command
|
|
|
|
# Load .local file at the end for post configurations
|
|
if [ -e "$HOME/.bashrc.local" ]; then
|
|
source "$HOME/.bashrc.local"
|
|
fi
|