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:
parent
78dccc90e1
commit
e61a42220c
1 changed files with 3 additions and 2 deletions
5
main.go
5
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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue