dotfiles/bash/bashrc.common

17 lines
364 B
Plaintext

# Add path function: check if path exists in $PATH, only then prepend the
# specified path to PATH
add_to_path() {
if [[ ! -z $1 && -d $1 && ":$PATH:" != *":$1:"* ]]; then
export PATH=$1:$PATH
fi
}
# Add $HOME/bin to PATH
add_to_path $HOME/bin
# Source all *.bash files in ~/.bashrc.d/
for f in $(ls $HOME/.bashrc.d/*.bash)
do
source $f
done