From 5357c2571315a7a5f83c860f006454842012cba7 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 15 Aug 2015 21:32:15 -0700 Subject: [PATCH] Don't run path helper if its alredy been run Also run it before setup_env --- dotfiles/lib/shellenv.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh index de7e2be0..fd0fe916 100644 --- a/dotfiles/lib/shellenv.sh +++ b/dotfiles/lib/shellenv.sh @@ -40,8 +40,6 @@ function _setup_env { # Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" - _source_shellenv_files - function with_shellrc { zsh -c "source ~/.zshrc && ""$@" } @@ -49,9 +47,6 @@ function _setup_env { # Travis completion [ -f "$HOME/.travis/travis.sh" ] && source "$HOME/.travis/travis.sh" - test -e /usr/libexec/path_helper && eval `/usr/libexec/path_helper -s` - - 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/" @@ -66,8 +61,11 @@ function _setup_env { export ENVIRONMENT_SETUP_DONE="$(date)" } -if [ -z ${ENVIRONMENT_SETUP_DONE+x} ]; then - _setup_env -else - _source_shellenv_files -fi +function _path_helper { + export PATH_HELPER_RAN="$(date)" + eval `/usr/libexec/path_helper -s` +} + +environment_variable_exists PATH_HELPER_RAN || _path_helper +environment_variable_exists ENVIRONMENT_SETUP_DONE || _setup_env +_source_shellenv_files