From 5b97ead5929bc4b11df05d64c6ff1973fcbaee22 Mon Sep 17 00:00:00 2001 From: Artem Khvastunov Date: Wed, 13 Sep 2023 08:38:05 +0200 Subject: [PATCH] Support universal binaries on macOS Since v0.102.0, hugo ships universal binaries for macOS. And since v0.103.0, it refers to macOS as Darwin. --- hugow | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hugow b/hugow index 3aee246..cf90664 100755 --- a/hugow +++ b/hugow @@ -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" ;; @@ -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"