]> git.r.bdr.sh - rbdr/mobius/blobdiff - cmd/mobius-hotline-client/main.go
Handler tracker list errors
[rbdr/mobius] / cmd / mobius-hotline-client / main.go
index 6bc2d58bce15bd25d9b3c9a43b96aa8def666def..72b581bb7634ad3508b473a0857d7a79daf3ee1b 100644 (file)
@@ -71,10 +71,9 @@ func main() {
                cancelRoot()
        }()
 
-       client := hotline.NewClient(*configDir, logger)
+       client := hotline.NewUIClient(*configDir, logger)
        client.DebugBuf = db
        client.UI.Start()
-
 }
 
 func newZapCore(level zapcore.Level, syncer zapcore.WriteSyncer) zapcore.Core {
@@ -97,12 +96,15 @@ var zapLogLevel = map[string]zapcore.Level{
 }
 
 func defaultConfigPath() (cfgPath string) {
-       os := runtime.GOOS
-       switch os {
+       switch runtime.GOOS {
        case "windows":
                cfgPath = "mobius-client-config.yaml"
        case "darwin":
-               cfgPath = "/usr/local/etc/mobius-client-config.yaml"
+               if _, err := os.Stat("/usr/local/etc/mobius-client-config.yaml"); err == nil {
+                       cfgPath = "/usr/local/etc/mobius-client-config.yaml"
+               } else if _, err := os.Stat("/opt/homebrew/etc/mobius-client-config.yaml"); err == nil {
+                       cfgPath = "/opt/homebrew/etc/mobius-client-config.yaml"
+               }
        case "linux":
                cfgPath = "/usr/local/etc/mobius-client-config.yaml"
        default: