fix windows default config path

This commit is contained in:
mlsmaycon 2021-06-20 23:33:49 +02:00
parent a66cdccda9
commit 74355a2292

View File

@ -33,7 +33,7 @@ func Execute() error {
func init() { func init() {
defaultConfigPath = "/etc/wiretrustee/config.json" defaultConfigPath = "/etc/wiretrustee/config.json"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
defaultConfigPath = os.Getenv("PROGRAMDATA") + "Wiretrustee" + "config.json" defaultConfigPath = os.Getenv("PROGRAMDATA") + "\\Wiretrustee\\" + "config.json"
} }
rootCmd.PersistentFlags().StringVar(&configPath, "config", defaultConfigPath, "Wiretrustee config file location to write new config to") rootCmd.PersistentFlags().StringVar(&configPath, "config", defaultConfigPath, "Wiretrustee config file location to write new config to")
rootCmd.PersistentFlags().StringVar(&logLevel, "log-level", "info", "") rootCmd.PersistentFlags().StringVar(&logLevel, "log-level", "info", "")