Just run from root always
This commit is contained in:
parent
dbdb988634
commit
3c8bb4ea68
|
@ -20,16 +20,9 @@ import (
|
||||||
const target = "command/plugin.go"
|
const target = "command/plugin.go"
|
||||||
|
|
||||||
func main() {
|
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()
|
wd, _ := os.Getwd()
|
||||||
if filepath.Base(wd) != "packer" {
|
if filepath.Base(wd) != "packer" {
|
||||||
os.Chdir("..")
|
log.Fatalf("This program must be invoked in the packer project root; in %s", wd)
|
||||||
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
|
// Collect all of the data we need about plugins we have in the project
|
||||||
|
|
Loading…
Reference in New Issue