Skip to content

Instantly share code, notes, and snippets.

@vraravam
Last active April 18, 2024 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vraravam/a64d51fff250271aa7669438db5bd6a5 to your computer and use it in GitHub Desktop.
Save vraravam/a64d51fff250271aa7669438db5bd6a5 to your computer and use it in GitHub Desktop.
file location: ~/.zshenv
#!/usr/bin/env zsh
# vim:syntax=zsh
# vim:filetype=zsh
# file location: ${HOME}/.zshenv
# invoked by all invocations of Zsh, so we should keep it small and merely initialise necessary variables.
# https://blog.patshead.com/2011/04/improve-your-oh-my-zsh-startup-time-maybe.html
skip_global_compinit=1
# http://disq.us/p/f55b78
# setopt noglobalrcs
# export SYSTEM=$(uname -s)
export ARCH=`uname -m`
if [[ "${ARCH}" =~ "arm" ]]; then
export HOMEBREW_PREFIX="/opt/homebrew"
else
export HOMEBREW_PREFIX="/usr/local"
fi
eval "$($HOMEBREW_PREFIX/bin/brew shellenv)"
# https://github.com/sorin-ionescu/prezto/blob/master/runcoms/zshenv
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ ( "${SHLVL}" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-${HOME}}/.zprofile" ]]; then
source "${ZDOTDIR:-${HOME}}/.zprofile"
fi
@vraravam
Copy link
Author

Moved setting of PATH to the .zprofile - since keeping it here meant that the homebrew path was inconsistently appearing before/after the system path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment