mirror of
https://github.com/TwiN/gatus.git
synced 2025-08-17 18:32:21 +02:00
fix: Log GATUS_CONFIG_FILE deprecation message only if it's non-empty
This commit is contained in:
3
main.go
3
main.go
@ -56,9 +56,10 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user