Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (41 sloc) 978 Bytes
#!/usr/bin/env bash
# Begin ~/.bash/profile
path_append () {
# First remove the directory
local IFS=':'
local NEWPATH
for DIR in $PATH; do
if [[ "$DIR" != "$1" ]]; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
# Then append the directory
export PATH="$NEWPATH:$1"
}
path_prepend () {
# First remove the directory
local IFS=':'
local NEWPATH
for DIR in $PATH; do
if [[ "$DIR" != "$1" ]]; then
NEWPATH=${NEWPATH:+$NEWPATH:}${DIR}
fi
done
# Then append the directory
export PATH="$1:$NEWPATH"
}
if [[ -f "$HOME/.bashrc" ]] ; then
source "$HOME/.bashrc"
fi
if [[ -d "$HOME/bin" ]] ; then
path_prepend "$HOME/bin"
fi
if [ -d "$HOME/.cabal/bin" ] ; then
path_prepend "$HOME/.cabal/bin"
fi
for cfg in vars rc
do
[[ -f $HOME/.bash/${cfg} ]] && source "$HOME/.bash/${cfg}"
[[ -f $HOME/.bash/${cfg}.local ]] && source "$HOME/.bash/${cfg}.local"
done
# End ~/.bash/profile