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
This commit is contained in:
2026-06-11 17:49:51 +08:00
parent be8dce7135
commit 3e4d071b4c
+5 -1
View File
@@ -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