From dfe47dea337c8dbe162d3b0237dccabba4496c8a Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Thu, 4 Mar 2021 14:33:29 -0500 Subject: [PATCH] Allow env to be reloaded --- aliases | 6 +----- env.loader | 9 +++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/aliases b/aliases index 906b3fb..99873a0 100644 --- a/aliases +++ b/aliases @@ -42,11 +42,7 @@ abort() { } reload() { - if [[ $platform == 'Linux' || $platform == 'Darwin' ]]; then - test -f ~/.aliases && . ~/.aliases - else - test -f ~/.aliases && . ~/.aliases - fi + test -f ~/.env.loader && . ~/.env.loader } update-shell() { diff --git a/env.loader b/env.loader index b8a555b..0ebd4f1 100644 --- a/env.loader +++ b/env.loader @@ -20,6 +20,11 @@ test -f "$HOME/.env.common-post" && . "$HOME/.env.common-post" test -f "$HOME/.aliases" && . "$HOME/.aliases" test -f "$HOME/.aliases.common" && . "$HOME/.aliases.common" test -f "$HOME/.aliases.private" && . "$HOME/.aliases.private" -test -d "$HOME/bin" && export PATH=$HOME/bin/:$PATH -test -d "$HOME/.dotfiles/bin" && export PATH=$HOME/.dotfiles/bin/:$PATH + +if [[ $_MC_SET_ENV_PATH -ne 1 ]]; then + test -d "$HOME/bin" && export PATH=$HOME/bin/:$PATH + test -d "$HOME/.dotfiles/bin" && export PATH=$HOME/.dotfiles/bin/:$PATH +fi + +export _MC_SET_ENV_PATH=1