Created
December 23, 2021 04:13
-
-
Save 6david9/2763798c3f8ffaf0d7a74cfa52d3ae3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
arch_name="$(uname -m)" | |
if [ "${arch_name}" = "x86_64" ]; then | |
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then | |
echo "Running on Rosetta 2" | |
else | |
echo "Running on native Intel" | |
fi | |
elif [ "${arch_name}" = "arm64" ]; then | |
echo "Running on ARM" | |
else | |
echo "Unknown architecture: ${arch_name}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment