scripts/build.sh: fix GOPATH/bin folder breaking build

If GOPATH/bin doesn't exists the build scripts just exists, leaving the
`terraform/bin` folder with only one single binary called `terraform`.
Discovered while setting up a new GOPATH just for terraform.
This commit is contained in:
Fatih Arslan 2015-04-15 19:36:44 +03:00
parent 43231b56d2
commit 0c80207bff
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ OLDIFS=$IFS
IFS=: MAIN_GOPATH=($GOPATH) IFS=: MAIN_GOPATH=($GOPATH)
IFS=$OLDIFS IFS=$OLDIFS
# Create GOPATH/bin if it's doesn't exists
if [ ! -d $MAIN_GOPATH/bin ]; then
echo "==> Creating GOPATH/bin directory..."
mkdir -p $MAIN_GOPATH/bin
fi
# Copy our OS/Arch to the bin/ directory # Copy our OS/Arch to the bin/ directory
DEV_PLATFORM="./pkg/$(go env GOOS)_$(go env GOARCH)" DEV_PLATFORM="./pkg/$(go env GOOS)_$(go env GOARCH)"
for F in $(find ${DEV_PLATFORM} -mindepth 1 -maxdepth 1 -type f); do for F in $(find ${DEV_PLATFORM} -mindepth 1 -maxdepth 1 -type f); do