Add GATUS_CONFIG_FILE env var to support custom config path

This commit is contained in:
TwinProduction committed 2020-03-08 18:16:39 -04:00
1 parent 6b30125a78
commit 16837562ea
2 files changed
+7 -3

No files matched your search

+3 -3
View File
@@ -25,10 +25,10 @@ func main() {
}
func loadConfiguration() *config.Config {
args := os.Args
var err error
if len(args) == 2 {
err = config.Load(args[1])
customConfigFile := os.Getenv("GATUS_CONFIG_FILE")
if len(customConfigFile) > 0 {
err = config.Load(customConfigFile)
} else {
err = config.LoadDefaultConfiguration()
}