From 1965535e69c4e30fb6bc5c5b648a8fd4b60b96ef Mon Sep 17 00:00:00 2001 From: Haruue Icymoon Date: Fri, 15 Sep 2023 15:48:29 +0800 Subject: [PATCH] fix: default config file selection close: #689 --- app/cmd/root.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/cmd/root.go b/app/cmd/root.go index bea91b4..95039a8 100644 --- a/app/cmd/root.go +++ b/app/cmd/root.go @@ -120,9 +120,10 @@ func initConfig() { } else { viper.SetConfigName("config") viper.SetConfigType("yaml") - viper.AddConfigPath("/etc/hysteria/") - viper.AddConfigPath("$HOME/.hysteria") + viper.SupportedExts = append([]string{"yaml", "yml"}, viper.SupportedExts...) viper.AddConfigPath(".") + viper.AddConfigPath("$HOME/.hysteria") + viper.AddConfigPath("/etc/hysteria/") } }