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