Don't error if the given data-dir doesn't exist

This commit is contained in:
Kyle Havlovitz 2016-12-15 12:30:18 -05:00
parent f93567ac78
commit 5d03ab53f3
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C
1 changed files with 4 additions and 2 deletions

View File

@ -213,8 +213,10 @@ func (c *Command) readConfig() *Config {
}
if finfo, err := os.Stat(config.DataDir); err != nil {
c.Ui.Error(fmt.Sprintf("Error getting data-dir: %s", err))
return nil
if !os.IsNotExist(err) {
c.Ui.Error(fmt.Sprintf("Error getting data-dir: %s", err))
return nil
}
} else if !finfo.IsDir() {
c.Ui.Error(fmt.Sprintf("The data-dir specified at %q is not a directory", config.DataDir))
return nil