script: fix build script regression to work on OSX

Use sed instead of cut to accomodate GNU and BSD differences

Fixes: #5240
release-3.0
Chris Laws 2016-05-01 12:05:38 +09:30
parent 262de75a7e
commit c071104fc4
1 changed files with 1 additions and 1 deletions

2
build
View File

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