From e61a42220c913f5fcb4249d2014414b32601c4b2 Mon Sep 17 00:00:00 2001 From: TwiN Date: Tue, 10 Jan 2023 19:04:19 -0500 Subject: [PATCH] fix: Log GATUS_CONFIG_FILE deprecation message only if it's non-empty --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f4aa2267..5b67a531 100644 --- a/main.go +++ b/main.go @@ -56,8 +56,9 @@ func loadConfiguration() (*config.Config, error) { configPath := os.Getenv("GATUS_CONFIG_PATH") // Backwards compatibility if len(configPath) == 0 { - configPath = os.Getenv("GATUS_CONFIG_FILE") - log.Println("WARNING: GATUS_CONFIG_FILE is deprecated. Please use GATUS_CONFIG_PATH instead.") + if configPath = os.Getenv("GATUS_CONFIG_FILE"); len(configPath) > 0 { + log.Println("WARNING: GATUS_CONFIG_FILE is deprecated. Please use GATUS_CONFIG_PATH instead.") + } } return config.LoadConfiguration(configPath) }