fix bash_profile
This commit is contained in:
parent
9897503647
commit
f7edcd4a4b
@ -1,31 +1,9 @@
|
|||||||
[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
|
# .bash_profile is *not* sourced when launching bash from some GUI terminal emulators
|
||||||
|
# However, it *is* sourced when logging in via TTY or ssh.
|
||||||
|
|
||||||
appendpath () {
|
# Due to this somewhat inconsistent behaviour, I ended up putting everything in
|
||||||
if [ -d "$1" ]; then
|
# .bashrc, which is more or less guarunteed to be sourced no matter what.
|
||||||
case ":$PATH:" in
|
|
||||||
*:"$1":*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
PATH="${PATH:+$PATH:}$1"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
appendpath "$HOME/.local/bin"
|
# [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
|
||||||
appendpath "$HOME/.local/scripts"
|
|
||||||
|
|
||||||
if command -v ruby > /dev/null && command -v gem > /dev/null; then
|
|
||||||
appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v go > /dev/null; then
|
|
||||||
export GOPATH="$HOME/.go"
|
|
||||||
[ -d "$HOME/go" ] && mv "$HOME/go" "$HOME/.go"
|
|
||||||
appendpath "$(go env GOPATH)/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v cargo > /dev/null; then
|
|
||||||
appendpath "$HOME/.cargo/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# vim:ft=sh
|
# vim:ft=sh
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user