Just run from root always

This commit is contained in:
Chris Bednarski 2016-02-05 11:16:39 -08:00
parent dbdb988634
commit 3c8bb4ea68
1 changed files with 1 additions and 8 deletions

View File

@ -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