Skip to content

Instantly share code, notes, and snippets.

@lidaobing
Created April 1, 2021 16:05
Show Gist options
  • Save lidaobing/0b5c41e5c73058a2005d9d3ae3539ff2 to your computer and use it in GitHub Desktop.
Save lidaobing/0b5c41e5c73058a2005d9d3ae3539ff2 to your computer and use it in GitHub Desktop.
if [ `uname` = 'Darwin' ]; then
if [ `arch` = 'arm64' ]; then
export PATH="/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:$PATH"
PS1_ARCH="[ARM]"
else
export PATH="/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:$PATH"
PS1_ARCH="[X86]"
fi
export PS1="$PS1_ARCH$PS1"
alias ibrew="arch -x86_64 /usr/local/bin/brew"
alias abrew="arch -arm64 /opt/homebrew/bin/brew"
alias ibash="arch -x86_64 /usr/local/bin/bash"
alias abash="arch -arm64 /opt/homebrew/bin/bash"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment