aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_profile
blob: 40f41c3d455594742cffbf8a352d50e185a058b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Load ~/.profile regardless of shell version
if [ -e "$HOME"/.profile ] ; then
    . "$HOME"/.profile
fi

# Ensure we're using at least version 2.05
if ! [ -n "$BASH_VERSINFO" ] ; then
    return
elif ((10#${BASH_VERSINFO[0]%%[![:digit:]]*} == 2)) && \
     ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
    return
fi

# Load any supplementary scripts, print a newline first
if [[ -d $HOME/.bash_profile.d ]] ; then
    printf '\n'
    for bash_profile in "$HOME"/.bash_profile.d/*.bash ; do
        if [[ -e $bash_profile ]] ; then
            source "$bash_profile"
        fi
    done
    unset -v bash_profile
fi

# Source interactive Bash config if it exists
if [[ -e $HOME/.bashrc ]] ; then
    source "$HOME"/.bashrc
fi