mirror of https://github.com/status-im/consul.git
Merge pull request #2599 from hashicorp/data-dir-handling
Don't error if data-dir doesn't exist
This commit is contained in:
commit
04f8e5adc0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue