mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 16:03:44 +01:00
Support config.yml (as an alternative to config.yaml)
This commit is contained in:
parent
5f93894341
commit
9cf118996d
@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/TwinProduction/gatus/core"
|
"github.com/TwinProduction/gatus/core"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,7 +22,14 @@ func Get() *Config {
|
|||||||
if config == nil {
|
if config == nil {
|
||||||
cfg, err := readConfigurationFile("config.yaml")
|
cfg, err := readConfigurationFile("config.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
if os.IsNotExist(err) {
|
||||||
|
cfg, err = readConfigurationFile("config.yml")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
config = cfg
|
config = cfg
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user