From 0dd80c0eca33164dbbd7749533f3a2318e2675eb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto <mitchell.hashimoto@gmail.com> Date: Sat, 13 Jun 2015 10:17:42 -0400 Subject: [PATCH] config file doesn't need to exist if set [GH-2225] --- main.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/main.go b/main.go index d0033628..aab28c14 100644 --- a/main.go +++ b/main.go @@ -217,12 +217,10 @@ func loadConfig() (*config, error) { return nil, err } - mustExist := true configFilePath := os.Getenv("PACKER_CONFIG") if configFilePath == "" { var err error configFilePath, err = configFile() - mustExist = false if err != nil { log.Printf("Error detecting default config file path: %s", err) @@ -240,11 +238,7 @@ func loadConfig() (*config, error) { return nil, err } - if mustExist { - return nil, err - } - - log.Println("File doesn't exist, but doesn't need to. Ignoring.") + log.Println("[WARN] Config file doesn't exist: %s", configFilePath) return &config, nil } defer f.Close() -- 2.30.9