try to minimize path footprint
This commit is contained in:
parent
99456fa31f
commit
bbf4f9bf49
@ -151,16 +151,12 @@ tma() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# checks if directory exists and path duplication
|
# checks for path duplication
|
||||||
appendpath () {
|
appendpath () {
|
||||||
if [ -d "$1" ]; then
|
[[ ":$PATH:" != *":$1:"* ]] && PATH="${PATH}:$1"
|
||||||
case ":$PATH:" in
|
}
|
||||||
*:"$1":*)
|
prependpath() {
|
||||||
;;
|
[[ ":$PATH:" != *":$1:"* ]] && PATH="$1:${PATH}"
|
||||||
*)
|
|
||||||
PATH="${PATH:+$PATH:}$1"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# easy backup
|
# easy backup
|
||||||
@ -229,29 +225,29 @@ fi
|
|||||||
|
|
||||||
## extra paths ##
|
## extra paths ##
|
||||||
|
|
||||||
# ruby (rbenv)
|
# # ruby (rbenv)
|
||||||
if command -v ruby > /dev/null && command -v gem > /dev/null; then
|
# if command -v ruby > /dev/null && command -v gem > /dev/null; then
|
||||||
appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
|
# appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin"
|
||||||
# rbenv shim
|
# # rbenv shim
|
||||||
if [ -d "$HOME/.rbenv/bin" ]; then
|
# if [ -d "$HOME/.rbenv/bin" ]; then
|
||||||
appendpath "$HOME/.rbenv/bin"
|
# appendpath "$HOME/.rbenv/bin"
|
||||||
[[ ":$PATH:" != *":$HOME/.rbenv/shims:"* ]] && eval "$(rbenv init -)"
|
# [[ ":$PATH:" != *":$HOME/.rbenv/shims:"* ]] && eval "$(rbenv init -)"
|
||||||
fi
|
# fi
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# node (nvm)
|
# # node (nvm)
|
||||||
if [ -d "$HOME/.nvm" ]; then
|
# if [ -d "$HOME/.nvm" ]; then
|
||||||
export NVM_DIR="$HOME/.nvm"
|
# export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# python (pyenv)
|
# # python (pyenv)
|
||||||
if [ -d "$HOME/.pyenv" ]; then
|
# if [ -d "$HOME/.pyenv" ]; then
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
# export PYENV_ROOT="$HOME/.pyenv"
|
||||||
appendpath "$PYENV_ROOT/bin"
|
# appendpath "$PYENV_ROOT/bin"
|
||||||
command -v pyenv > /dev/null && eval "$(pyenv init -)"
|
# command -v pyenv > /dev/null && eval "$(pyenv init -)"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# go
|
# go
|
||||||
if command -v go > /dev/null; then
|
if command -v go > /dev/null; then
|
||||||
@ -268,8 +264,8 @@ if command -v cargo > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# local bins
|
# local bins
|
||||||
appendpath "$HOME/.local/bin"
|
[ -d "$HOME/.local/bin" ] && appendpath "$HOME/.local/bin"
|
||||||
appendpath "$HOME/.local/scripts"
|
[ -d "$HOME/.local/scripts" ] && appendpath "$HOME/.local/scripts"
|
||||||
|
|
||||||
## extra tools ##
|
## extra tools ##
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user