1
0
Fork 0
mirror of https://github.com/TwiN/gatus.git synced 2024-12-14 11:58:04 +00:00

fix: Log GATUS_CONFIG_FILE deprecation message only if it's non-empty

This commit is contained in:
TwiN 2023-01-10 19:04:19 -05:00
parent 78dccc90e1
commit e61a42220c

View file

@ -56,8 +56,9 @@ func loadConfiguration() (*config.Config, error) {
configPath := os.Getenv("GATUS_CONFIG_PATH") configPath := os.Getenv("GATUS_CONFIG_PATH")
// Backwards compatibility // Backwards compatibility
if len(configPath) == 0 { if len(configPath) == 0 {
configPath = os.Getenv("GATUS_CONFIG_FILE") if configPath = os.Getenv("GATUS_CONFIG_FILE"); len(configPath) > 0 {
log.Println("WARNING: GATUS_CONFIG_FILE is deprecated. Please use GATUS_CONFIG_PATH instead.") log.Println("WARNING: GATUS_CONFIG_FILE is deprecated. Please use GATUS_CONFIG_PATH instead.")
}
} }
return config.LoadConfiguration(configPath) return config.LoadConfiguration(configPath)
} }