Fix: don't read yml if not exist (#253)
This commit is contained in:
parent
528fbd10e4
commit
288afd1308
@ -106,9 +106,13 @@ func readRawConfig(path string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
path = path[:len(path)-5] + ".yml"
|
path = path[:len(path)-5] + ".yml"
|
||||||
|
if _, err = os.Stat(path); err == nil {
|
||||||
return ioutil.ReadFile(path)
|
return ioutil.ReadFile(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return data, nil
|
||||||
|
}
|
||||||
|
|
||||||
func readConfig(path string) (*rawConfig, error) {
|
func readConfig(path string) (*rawConfig, error) {
|
||||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user