Skip to content

Commit

Permalink
Support universal binaries on macOS
Browse files Browse the repository at this point in the history
Since v0.102.0, hugo ships universal binaries for macOS. And since v0.103.0, it refers to macOS as Darwin.
  • Loading branch information
artspb committed Sep 13, 2023
1 parent f34d87f commit 5b97ead
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions hugow
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fi
os_type=""

case "$(uname -s)" in
Darwin) os_type="macOS" ;;
Darwin) os_type="Darwin" ;;
Linux) os_type="Linux" ;;
DragonFly) os_type="DragonFlyBSD" ;;
FreeBSD) os_type="FreeBSD" ;;
Expand All @@ -146,14 +146,18 @@ esac
# OS architecture
os_arch=""

case "$(uname -m)" in
x86) os_arch="32bit" ;;
x86_64) os_arch="64bit" ;;
amd64) os_arch="64bit" ;;
armv7l) os_arch="ARM" ;;
armv8) os_arch="ARM64" ;;
arm64) os_arch="ARM64" ;;
esac
if [ "$os_type" = "Darwin" ]; then
os_arch="Universal"
else
case "$(uname -m)" in
x86) os_arch="32bit" ;;
x86_64) os_arch="64bit" ;;
amd64) os_arch="64bit" ;;
armv7l) os_arch="ARM" ;;
armv8) os_arch="ARM64" ;;
arm64) os_arch="ARM64" ;;
esac
fi

if [ -z "$os_type" ] || [ -z "$os_arch" ]; then
echo "Error: Unknown OS type or architecture"
Expand Down

0 comments on commit 5b97ead

Please sign in to comment.