From 3e4d071b4cc1e9671cd8642cd06dc7ee4691ba85 Mon Sep 17 00:00:00 2001 From: mamamiyear Date: Thu, 11 Jun 2026 17:49:51 +0800 Subject: [PATCH] chore: building script has better compatibility - The build script will fallback to using GOPATH instead of GOBIN when the GOBIN environment variable is not set --- scripts/dev-build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dev-build.sh b/scripts/dev-build.sh index b6fad37..f67e226 100755 --- a/scripts/dev-build.sh +++ b/scripts/dev-build.sh @@ -20,7 +20,11 @@ cd "${ROOT_DIR}" CERT_CN="${CERT_CN:-SnapGo Dev Cert}" # 1. Make sure wails is on PATH (works whether or not the user added it). -export PATH="$(go env GOBIN):${PATH}" +_GOBINPATH=$(go env GOBIN) +if [ "${_GOBINPATH}X" == "X" ]; then + _GOBINPATH=$(go env GOPATH)/bin +fi +export PATH="${_GOBINPATH}:${PATH}" # 2. Make sure the dev cert exists. If not, abort with a clear pointer. if ! security find-identity -v -p codesigning | grep -q "${CERT_CN}"; then