Skip to content
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