mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Dot-env is a cross-platform, cascading Zsh environment system for those who work on different hardware and OS environments. See: https://github.com/midwire/.env
31 lines
490 B
Bash
31 lines
490 B
Bash
paths="${DOT_ENV_PATH}/bin
|
|
/sbin
|
|
/bin
|
|
/usr/X11/bin
|
|
/usr/local/bin
|
|
/usr/sbin
|
|
/usr/bin"
|
|
|
|
EGREP=`which egrep`
|
|
function pathmunge () {
|
|
if ! echo $PATH | $EGREP "(^|:)$1($|:)" > /dev/null ; then
|
|
if [ -d "$1" ]; then
|
|
if [ "$2" = "before" ] ; then
|
|
PATH="$1:$PATH"
|
|
else
|
|
PATH="$PATH:$1"
|
|
fi
|
|
fi
|
|
fi
|
|
}
|
|
|
|
for p in $paths; do
|
|
pathmunge $p
|
|
done
|
|
|
|
# Prepend path with $HOME/bin
|
|
pathmunge "$HOME/bin" before
|
|
|
|
PATH=`echo $PATH | sed -e 's/^\://' -e 's/\:\:/:/g'`
|
|
unset paths
|
|
export PATH
|