Created
November 24, 2021 10:24
-
-
Save agirorn/34c4b95edac64c5e81a83c2812dd311b to your computer and use it in GitHub Desktop.
Skip a command on an Apple computer with M1 ARM-based CPU
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
#!/usr/bin/env bash | |
# | |
# Usage | |
# | |
# skip_in_m1 cmd [ARGS] | |
# | |
# example: | |
# skip_in_m1 echo "This is not an Apple computer with M1 ARM-based CPU" | |
CMD="$@" | |
echo $OSTYPE | grep -q darwin && uname -m | grep -q 'arm64'; | |
if [[ $? == 0 ]]; then | |
printf "Skipping on Apple Mac with an M1 cpu: \"${CMD}\"\n" | |
exit 0 | |
fi | |
eval "${CMD}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment