"context"
"flag"
"fmt"
- hotline "github.com/jhalter/mobius"
+ "github.com/jhalter/mobius/hotline"
"github.com/rivo/tview"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"log"
"os"
"os/signal"
+ "runtime"
"syscall"
)
cancelRoot()
}()
- client := hotline.NewClient("", logger)
+ cfgPath := defaultConfigPath()
+
+ client := hotline.NewClient(cfgPath, logger)
client.DebugBuf = db
client.UI.Start()
"warn": zap.WarnLevel,
"error": zap.ErrorLevel,
}
+
+func defaultConfigPath() (cfgPath string) {
+ os := runtime.GOOS
+ switch os {
+ case "windows":
+ cfgPath = "mobius-client-config.yaml"
+ case "darwin":
+ cfgPath = "/usr/local/etc/mobius-client-config.yaml"
+ case "linux":
+ cfgPath = "/usr/local/etc/mobius-client-config.yaml"
+ default:
+ fmt.Printf("unsupported OS")
+ }
+
+ return cfgPath
+}