Commit e80b1c31 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #2226 from mitchellh/b-config-file

config file doesn't need to exist if set [GH-2225]
parents a95408aa 511013db
......@@ -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.Printf("[WARN] Config file doesn't exist: %s", configFilePath)
return &config, nil
}
defer f.Close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment