mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
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:
parent
f4944d5a95
commit
ae2db75f3e
20 changed files with 629 additions and 0 deletions
31
plugins/dot-env/global/global_path.sh
Normal file
31
plugins/dot-env/global/global_path.sh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue