From 1ce2ab2382488bb8e1a285351b7a341875d0caf8 Mon Sep 17 00:00:00 2001 From: wuyangfan <1102042793@qq.com> Date: Sun, 17 May 2026 18:49:27 +0800 Subject: [PATCH] fix(build): use portable date and uname -m in build.sh GNU date --utc and arch(1) break on macOS. Use BSD-compatible date -u fallback and uname -m for BUILD_ARCH on all platforms. Fixes #32 --- build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index f8b9fd6..d31e514 100755 --- a/build.sh +++ b/build.sh @@ -8,8 +8,12 @@ go vet GIT_COMMIT="$(git rev-parse --short $(git rev-list -1 HEAD))" GIT_TAG="$(git tag --points-at HEAD)" GO_VERSION="$(go version | cut -d' ' -f3)" -BUILD_DATE="$(date --utc)" -BUILD_ARCH="$(arch)" +if date --utc >/dev/null 2>&1; then + BUILD_DATE="$(date --utc)" +else + BUILD_DATE="$(date -u)" +fi +BUILD_ARCH="$(uname -m)" if [ "$(git status -s | wc -l)" -eq "0" ]; then BUILD_TAINTED=false else