Added dot-env plugin

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
This commit is contained in:
Chris Blackburn 2012-01-21 19:12:38 -06:00
commit ae2db75f3e
20 changed files with 629 additions and 0 deletions

View file

@ -0,0 +1,31 @@
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