Skip to content

Instantly share code, notes, and snippets.

@chrisjrn
Created July 12, 2021 20:42
Show Gist options
  • Select an option

  • Save chrisjrn/63450a717176ff9cd708b7eca694cc24 to your computer and use it in GitHub Desktop.

Select an option

Save chrisjrn/63450a717176ff9cd708b7eca694cc24 to your computer and use it in GitHub Desktop.
Homebrew for arch-specific shells
#!/bin/sh
# HOW TO USE:
# 1. Install homebrew to the default location in an ARM shell (`arch -arm64 zsh`) then in an intel shell (`arch -x86_64 zsh`)
# 2. Save this file somewhere in your home directory
# 3. Add the following command to your ~/.zprofile file: eval "$(zsh ~/bin/homebrew_shellenv.sh)"
ARCH=`arch`
if [[ "$ARCH" = "arm64" ]]
then
BIN_BREW="/opt/homebrew/bin/brew"
else
BIN_BREW="/usr/local/Homebrew/bin/brew"
fi
$BIN_BREW shellenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment