Just run from root always
This commit is contained in:
parent
dbdb988634
commit
3c8bb4ea68
|
@ -20,17 +20,10 @@ import (
|
|||
const target = "command/plugin.go"
|
||||
|
||||
func main() {
|
||||
// Normally this is run via go:generate from the command folder so we need
|
||||
// to cd .. first. But when developing it's easier to use go run, so we'll
|
||||
// support that too.
|
||||
wd, _ := os.Getwd()
|
||||
if filepath.Base(wd) != "packer" {
|
||||
os.Chdir("..")
|
||||
wd, _ = os.Getwd()
|
||||
if filepath.Base(wd) != "packer" {
|
||||
log.Fatalf("This program must be invoked in the packer project root; in %s", wd)
|
||||
}
|
||||
}
|
||||
|
||||
// Collect all of the data we need about plugins we have in the project
|
||||
builders, err := discoverBuilders()
|
||||
|
|
Loading…
Reference in New Issue