2020-04-02 14:44:29 +11:00
|
|
|
function __prepend_path {
|
|
|
|
if [ -z "$(eval echo \$$1)" ]; then
|
|
|
|
eval "$1=\"$2\""
|
|
|
|
else
|
|
|
|
eval "$1=\"$2:\$$1\""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-01-05 14:41:41 +11:00
|
|
|
function __append_path {
|
|
|
|
if [ -z "$(eval echo \$$1)" ]; then
|
|
|
|
eval "$1=\"$2\""
|
|
|
|
else
|
|
|
|
eval "$1=\"\$$1:$2\""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-04-02 14:44:29 +11:00
|
|
|
[ -d "$HOME/bin" ] && __prepend_path "PATH" "$HOME/bin"
|
2020-10-24 17:11:43 +11:00
|
|
|
[ -d "$HOME/.local/bin" ] && __prepend_path "PATH" "$HOME/.local/bin"
|
2020-04-02 14:44:29 +11:00
|
|
|
[ -d "$HOME/.cargo/bin" ] && __prepend_path "PATH" "$HOME/.cargo/bin"
|
|
|
|
[ -d "$HOME/.emacs.d/bin" ] && __prepend_path "PATH" "$HOME/.emacs.d/bin"
|
2020-08-23 11:27:51 +10:00
|
|
|
[ -d "$HOME/.dotfiles/bin" ] && __prepend_path "PATH" "$HOME/.dotfiles/bin"
|
2020-04-02 14:44:29 +11:00
|
|
|
[ -d '/usr/local/bin' ] && __append_path "PATH" "/usr/local/bin"
|
|
|
|
[ -d '/usr/local/sbin' ] && __append_path "PATH" "/usr/local/sbin"
|
|
|
|
[ -d '/opt/local/bin' ] && __append_path "PATH" "/opt/local/bin"
|
|
|
|
[ -d '/opt/local/sbin' ] && __append_path "PATH" "/opt/local/sbin"
|
|
|
|
[ -d '/usr/X11/bin' ] && __append_path "PATH" "/usr/X11/bin"
|
|
|
|
[ -d '/usr/bin' ] && __append_path "PATH" "/usr/bin"
|
|
|
|
[ -d '/usr/sbin' ] && __append_path "PATH" "/usr/sbin"
|
|
|
|
[ -d '/bin' ] && __append_path "PATH" "/bin"
|
|
|
|
[ -d '/sbin' ] && __append_path "PATH" "/sbin"
|