File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 6161 -arch=" ${XC_ARCH} " \
6262 -osarch=" ${XC_EXCLUDE_OSARCH} " \
6363 -ldflags " ${LD_FLAGS} " \
64- -output " pkg/{{.OS}}_{{.Arch}}/${PWD ##*/ } " \
64+ -output " pkg/{{.OS}}_{{.Arch}}/terraform " \
6565 .
6666
6767# Move all the compiled things to the $GOPATH/bin
Original file line number Diff line number Diff line change @@ -19,9 +19,8 @@ import (
1919const target = "command/internal_plugin_list.go"
2020
2121func main () {
22- wd , _ := os .Getwd ()
23- if filepath .Base (wd ) != "terraform" {
24- log .Fatalf ("This program must be invoked in the terraform project root; in %s" , wd )
22+ if isProjectRoot () == false {
23+ log .Fatalf ("This program must be invoked in the terraform project root" )
2524 }
2625
2726 //// Collect all of the data we need about plugins we have in the project
@@ -80,6 +79,15 @@ func makeProviderMap(items []plugin) string {
8079 return output
8180}
8281
82+ func isProjectRoot () bool {
83+ _ , err := os .Stat ("go.mod" )
84+ if os .IsNotExist (err ) {
85+ return false
86+ }
87+
88+ return true
89+ }
90+
8391// makeProvisionerMap creates a map of provisioners like this:
8492//
8593// "chef": chefprovisioner.Provisioner,
You can’t perform that action at this time.
0 commit comments