Fix PATH setup on macOS

This commit is contained in:
2020-02-22 18:14:58 +00:00
parent 80c77c8c2b
commit f55a087fe1
2 changed files with 28 additions and 8 deletions

12
zshrc
View File

@@ -2,9 +2,11 @@
# Z-Shell Init
#
# Fix PATH re-ordering done by macOS, by loading ~/.zshenv again.
if [[ "$(uname)" == "Darwin" ]] && [ -x "/usr/libexec/path_helper" ]; then
source "$HOME/.zshenv"
# In our zshenv file we have on macOS disabled loading ZSH startup files from
# /etc to avoid /etc/zprofile messing up our carefully constructed PATH. So we
# need to manually load the other files we care about.
if [[ "$OSTYPE" == "darwin"* ]] && [ -f "/etc/zshrc" ]; then
source "/etc/zshrc";
fi
@@ -75,8 +77,8 @@ fpath=("$DOTZSH/completion" "${fpath[@]}")
source "$DOTZSH/aliases.zsh"
# OS specific
if [[ "$(uname)" == "Darwin" ]]; then source "$DOTZSH/macos.zsh"; fi
if [[ "$(uname)" == "Linux" ]]; then source "$DOTZSH/linux.zsh"; fi
if [[ "$OSTYPE" == "darwin"* ]]; then source "$DOTZSH/macos.zsh"; fi
if [[ "$OSTYPE" == "linux"* ]]; then source "$DOTZSH/linux.zsh"; fi
# Utils
source "$DOTZSH/emacs.zsh"