91ebf6e21f
* Made PATH initializing smarter * zsh rcfiles are no longer fired twice (thanks to zshenv) * Introduced speculative rb|pyenv support * General cleanup all around
41 lines
990 B
Bash
41 lines
990 B
Bash
|
|
function _init_paths {
|
|
export PATH=/usr/bin:/bin:/usr/sbin
|
|
|
|
# Setup homebrew paths
|
|
if [ -e /usr/local/bin/brew ]; then
|
|
local BREWDIR=`/usr/local/bin/brew --prefix`
|
|
|
|
PATH=$BREWDIR/bin:$PATH
|
|
|
|
local COREUTILS=`brew --prefix coreutils`
|
|
if [ -d "$COREUTILS" ]; then
|
|
PATH="$COREUTILS/libexec/gnubin:$PATH"
|
|
MANPATH="$COREUTILS/libexec/gnuman:$MANPATH"
|
|
fi
|
|
fi
|
|
|
|
# rb/pyenv paths
|
|
local RBENV_DIR="`brew --prefix rbenv`"
|
|
local PYENV_DIR="`brew --prefix pyenv`"
|
|
if [ -d "$RBENV_DIR" ]; then
|
|
PATH=$RBENV_DIR/bin:$PATH
|
|
export RBENV_ROOT=$RBENV_DIR
|
|
fi
|
|
if [ -d "$PYENV_DIR" ]; then
|
|
PATH=$PYENV_DIR/bin:$PATH
|
|
export PYENV_ROOT=$PYENV_DIR
|
|
fi
|
|
|
|
# hostname-specific bins
|
|
[ -d $HOME/.dotfiles/bin/`hostname` ] && PATH=$HOME/.dotfiles/bin/`hostname`:$PATH
|
|
|
|
# global bins
|
|
PATH=$HOME/.dotfiles/bin:$PATH
|
|
}
|
|
|
|
_init_paths
|
|
unset -f _init_paths
|
|
|
|
# vim:set ft=zsh:
|