瀏覽代碼

Merge pull request #5260 from glevand/for-merge-build

build: Simplify host detection
Anthony Romano 9 年之前
父節點
當前提交
1a0d1ab4ab
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      build

+ 1 - 3
build

@@ -11,9 +11,7 @@ GIT_SHA=`git rev-parse --short HEAD || echo "GitNotFound"`
 
 LINK_OPERATOR="="
 
-host_arch=$(GOARCH="" go env | egrep 'GOARCH=' | sed 's/^GOARCH="\(.*\)".*/\1/')
-
-if [ -z "${GOARCH}" ] || [ "${GOARCH}" = "${host_arch}" ]; then
+if [ -z "${GOARCH}" ] || [ "${GOARCH}" = "$(go env GOHOSTARCH)" ]; then
 	out="bin"
 else
 	out="bin/${GOARCH}"