This commit is contained in:
Geoffrey Frogeye 2019-06-11 06:28:58 +02:00
parent 0ee03a1173
commit c427ac3370
6 changed files with 43 additions and 11 deletions

View file

@ -87,21 +87,33 @@ appendpath() {
*:"$1":*) ;;
*)
# TODO Reverse order: I want the latest ones to supersedes the older ones
export PATH="${PATH:+$PATH:}$1"
;;
esac
}
appendpath '/usr/lib/ccache/bin'
appendpath "${GOPATH}/bin"
appendpath "$HOME/.local/bin"
appendpath "$HOME/.config/scripts"
prependpath() {
if [ ! -d "$1" ]; then
return
fi
case ":$PATH:" in
*:"$1":*) ;;
*)
export PATH="$1${PATH:+:$PATH}"
;;
esac
}
prependpath '/usr/lib/ccache/bin'
prependpath "${GOPATH}/bin"
prependpath "$HOME/.local/bin"
prependpath "$HOME/.config/scripts"
# If running on termux, load those extra scripts
[ -d /data/data/com.termux/ ] && (
appendpath "$HOME/.termux/scripts"
appendpath "$HOME/.termux/bin"
prependpath "$HOME/.termux/scripts"
prependpath "$HOME/.termux/bin"
)
# For superseding commands with better ones if they are present