From d60314fbb572f49cdb7d133f51fbbe4148a43be2 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 5 Jul 2016 12:14:11 -0700 Subject: [PATCH] Organize _setup_env --- dotfiles/lib/shellenv.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh index 34811197..0075a7be 100644 --- a/dotfiles/lib/shellenv.sh +++ b/dotfiles/lib/shellenv.sh @@ -19,8 +19,8 @@ function get_python_scripts_path { function _setup_env { _path_helper + hash brew 2>/dev/null && add_to_path "$(brew --prefix coreutils)/libexec/gnubin" add_to_path /usr/local/lib/python2.7/site-packages --after - add_to_path "$HOME/.rvm/bin" --after add_to_path "$HOME/bin" hash brew 2>/dev/null && add_to_path --before "$(brew --prefix coreutils)/libexec/gnubin" add_to_path "/usr/local/bin" @@ -49,18 +49,12 @@ function _setup_env { add_to_path "$HOME/.lib/python" --after add_to_path "/usr/local/sbin" --after - add_to_path "$HOME/.cargo/bin" - - # Load RVM into a shell session *as a function* - [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" function with_shellrc { zsh -c "source ~/.zshrc && ""$@" } - # Travis completion - [ -f "$HOME/.travis/travis.sh" ] && source "$HOME/.travis/travis.sh" - + # node/nvm export NVM_DIR="/Users/imalison/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm export NODE_PATH="/usr/local/lib/node_modules/" @@ -68,13 +62,23 @@ function _setup_env { add_to_path "$HOME/.local/bin" add_to_path "$HOME/.lib/python" --path-var 'PYTHONPATH' + # golang add_to_path "$HOME/go" --path-var 'GOPATH' add_to_path "${GOPATH//://bin:}/bin" + # ruby + # Load RVM into a shell session *as a function* + [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" export RBENV_ROOT=/usr/local/var/rbenv add_to_path "$HOME/.rbenv/bin" + add_to_path "$HOME/.rvm/bin" --after hash rbenv 2> /dev/null && eval "$(rbenv init -)" - hash brew 2>/dev/null && add_to_path "$(brew --prefix coreutils)/libexec/gnubin" + + # rust + add_to_path "$HOME/.cargo/bin" + + # Travis completion + [ -f "$HOME/.travis/travis.sh" ] && source "$HOME/.travis/travis.sh" add_to_path "$HOME/.lib/bin" export ENVIRONMENT_SETUP_DONE="$(date)"