Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using different paths for M1 or Intel processor #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions scripts/shell/zsh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ case $1 in
"$DOTLY_PATH/bin/dot" shell zsh reload_completions
;;
"test_performance")
if [[ $(uname -m) == 'arm64' ]]; then
ZSH_BIN_PATH='/opt/homebrew/bin/zsh'
else
ZSH_BIN_PATH='/usr/local/bin/zsh'
fi
Comment on lines +25 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZSH_BIN_PATH="$(brew --prefix zsh)"

You can get the prefix of installed packages with brew with brew --prefix <package>

But could happen that the command is being executed in a system without brew or installed in other way or with brew prefix not added but installed.

script::depends_on hyperfine

hyperfine '/bin/zsh -i -c exit' '/opt/homebrew/bin/zsh -i -c exit' --warmup 1
hyperfine '/bin/zsh -i -c exit' "${ZSH_BIN_PATH} -i -c exit" --warmup 1

echo ""
echo "ZSH INFO:"
echo " 🍎 macOS ZSH 📂 /bin/zsh - $(/bin/zsh --version)"
echo " 🍺 Brew ZSH 📂 /opt/homebrew/bin/zsh - $(/opt/homebrew/bin/zsh --version)"
echo " 🍺 Brew ZSH 📂 ${ZSH_BIN_PATH} - $(${ZSH_BIN_PATH} --version)"

echo ""
echo "✨ Currently using $(command -v zsh) ✨"
Expand Down