Fix: don't read yml if not exist (#253)

This commit is contained in:
Siji 2019-08-07 14:21:39 +08:00 committed by Dreamacro
parent 528fbd10e4
commit 288afd1308
1 changed files with 5 additions and 1 deletions

View File

@ -106,7 +106,11 @@ func readRawConfig(path string) ([]byte, error) {
}
path = path[:len(path)-5] + ".yml"
return ioutil.ReadFile(path)
if _, err = os.Stat(path); err == nil {
return ioutil.ReadFile(path)
}
return data, nil
}
func readConfig(path string) (*rawConfig, error) {