Use a new method for prepending to the PATH variable.

This commit is contained in:
Scott Wallace 2016-02-16 19:20:07 +00:00
parent 5b4a73f178
commit 91c4fe431c

10
.bashrc
View file

@ -1,3 +1,9 @@
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="$1${PATH:+":$PATH"}"
fi
}
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# The best editor # The best editor
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
@ -20,7 +26,9 @@ mkdir -p ~/src ~/tmp ~/var/log
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Update the path with local overrides # Update the path with local overrides
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
export PATH=~/bin:/usr/local/bin:/usr/local/sbin:${PATH} pathadd /usr/local/sbin
pathadd /usr/local/bin
pathadd ~/bin
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------