Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Improves portability of GOOS and GOARCH
Browse files Browse the repository at this point in the history
- GOOS and GOARCH can be effectively detected by 'go env'
- Supports MinGW
  • Loading branch information
jcooklin authored and Joel R Cooklin committed Feb 14, 2017
1 parent 85079bc commit 50d5776
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/build_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ _info "git commit: $(git log --pretty=format:"%H" -1)"
export CGO_ENABLED=0

# rebuild binaries:
export GOOS=${GOOS:-$(uname -s | tr '[:upper:]' '[:lower:]')}
export GOARCH=${GOARCH:-"amd64"}
export GOOS=${GOOS:-$(go env GOOS)}
export GOARCH=${GOARCH:-$(go env GOARCH)}

OS=$(uname -s)
if [[ "${OS}" == "Darwin" ]]; then
Expand All @@ -58,5 +58,5 @@ else
fi

mkdir -p "${build_path}/plugins"
_info "building plugins for ${GOOS}/${GOARCH} in ${p} parallels"
_info "building plugins for ${GOOS}/${GOARCH} in ${p} parallel processes"
find "${__proj_dir}/plugin/" -type d -iname "snap-*" -print0 | xargs -0 -n 1 -P $p -I{} "${__dir}/build_plugin.sh" {}
4 changes: 2 additions & 2 deletions scripts/build_snap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ _info "git commit: $(git log --pretty=format:"%H" -1)"
export CGO_ENABLED=0

# rebuild binaries:
export GOOS=${GOOS:-$(uname -s | tr '[:upper:]' '[:lower:]')}
export GOARCH=${GOARCH:-"amd64"}
export GOOS=${GOOS:-$(go env GOOS)}
export GOARCH=${GOARCH:-$(go env GOARCH)}

if [[ "${GOARCH}" == "amd64" ]]; then
build_path="${__proj_dir}/build/${GOOS}/x86_64"
Expand Down

0 comments on commit 50d5776

Please sign in to comment.