Skip to content

Commit

Permalink
Fix reporting of CPU brand on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mbautin committed Sep 24, 2024
1 parent e071537 commit f5b089b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build_and_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,17 @@ log "CPU architecture as reported by arch : $( arch )"

if [[ $OSTYPE == darwin* ]]; then
# Check if the Mac is using an Apple Silicon chip
if /usr/sbin/sysctl -n machdep.cpu.brand_string | grep -q "Apple"; then
cpu_brand_string=$( /usr/sbin/sysctl -n machdep.cpu.brand_string )
log "CPU brand string: $cpu_brand_string"
if [[ $cpu_brand_string == *Apple* ]]; then
# Check if Rosetta 2 is installed
if /usr/bin/pgrep oahd &>/dev/null; then
echo "Rosetta 2 is installed."
log "Rosetta 2 is installed."
else
echo "Rosetta 2 is not installed."
log "Rosetta 2 is not installed."
fi
else
echo "This appears to be a non-Apple Silicon Mac, not checking for Rosetta 2."
log "This appears to be a non-Apple Silicon Mac, not checking for Rosetta 2."
fi
fi

Expand Down

0 comments on commit f5b089b

Please sign in to comment.