dotfiles/bash/bash_profile
2020-05-12 01:47:30 -04:00

25 lines
467 B
Bash

[[ -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc"
appendpath () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
# home paths
user_paths=("$HOME/bin" "$HOME/.local/bin" "$HOME/scripts" "$HOME/.local/scripts")
# language paths
user_paths+=("$HOME/.cargo/bin" "$HOME/go/bin" "$HOME/.local/go/bin")
for path in "${user_paths[@]}"; do
if [ -d $path ]; then
appendpath $path
fi
done
# vim:ft=sh