From 55d4e460de98bf5d5c904a2a9eb421301f1d9ef2 Mon Sep 17 00:00:00 2001 From: Loren Gordon Date: Mon, 30 Oct 2017 09:06:39 -0400 Subject: [PATCH] Uses the current working directory to name the built binary This patch allows `build.sh` to be used with terraform plugins to easily create cross-platform packages, using the same method as the terraform Makefile: ``` mkdir scripts curl https://raw.githubusercontent.com/hashicorp/terraform/master/scripts/build.sh -o scripts/build.sh TF_RELEASE=1 sh -c "scripts/build.sh" # make bin ``` --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 42b3722a5..45e297d1d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -54,7 +54,7 @@ gox \ -arch="${XC_ARCH}" \ -osarch="${XC_EXCLUDE_OSARCH}" \ -ldflags "${LD_FLAGS}" \ - -output "pkg/{{.OS}}_{{.Arch}}/terraform" \ + -output "pkg/{{.OS}}_{{.Arch}}/${PWD##*/}" \ . # Move all the compiled things to the $GOPATH/bin