Use config.yml consistently (not config.yaml) (#789)

This commit is contained in:
John Maguire
2022-12-19 12:45:15 -05:00
committed by GitHub
parent ad7222509d
commit a3e6edf9c7
2 changed files with 13 additions and 2 deletions

View File

@@ -49,6 +49,14 @@ func (p *program) Stop(s service.Service) error {
return nil
}
func fileExists(filename string) bool {
_, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return true
}
func doService(configPath *string, configTest *bool, build string, serviceFlag *string) {
if *configPath == "" {
ex, err := os.Executable()
@@ -56,6 +64,9 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag *
panic(err)
}
*configPath = filepath.Dir(ex) + "/config.yaml"
if !fileExists(*configPath) {
*configPath = filepath.Dir(ex) + "/config.yml"
}
}
svcConfig := &service.Config{