# .bash_profile
# Adrian Abeyta <adrian@adrianabeyta.com>
# 2026.04.05

# don't do anything if not running interactively
case $- in
    *i*) ;;
    *) return;;
esac

# include user home bins if they exist
if [ -d "$HOME/bin" ] ; then
  PATH="$HOME/bin:$PATH"
fi;
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi;

# load the dotfiles
for file in ~/.{env,path,bash_prompt,aliases,functions}; do
    [ -r "$file" ] && [ -f "$file" ] && \
        source "$file";
    done;
unset file;

# fun scripts
if is_true "${HAVE_FUN:-}"; then
    source ~/.fun
fi

shopt -s nocaseglob; # case-insensitive globbing
shopt -s histappend; # append to bash history file
shopt -s cdspell; # autocorrect typos in path names when cd'ing
shopt -s checkwinsize # update col/line values on each command

# enable tab completion for 'g' by marking as alias for 'git'
if type _git &> /dev/null; then
    complete -o default -o nospace -F _git g;
fi;

# startup oh-my-posh
OMP_THEME="~/.omp/themes/custom.json"
eval "$(oh-my-posh init bash --config $OMP_THEME)"
