From 96587792ccd14e5f5bcd9bd241a079e5c03dcfcd Mon Sep 17 00:00:00 2001 From: nxshock Date: Fri, 21 Oct 2022 19:37:30 +0500 Subject: [PATCH] Default config path = bin path + config name --- config.go | 2 +- consts.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index ecc2f9e..a65dff4 100644 --- a/config.go +++ b/config.go @@ -31,7 +31,7 @@ func initConfig() error { return fmt.Errorf("Usage: %s [path to config]", filepath.Base(ex)) } - configFilePath := defaultConfigFilePath + configFilePath := filepath.Join(filepath.Dir(ex), defaultConfigFileName) if len(os.Args) == 2 { configFilePath = os.Args[1] } diff --git a/consts.go b/consts.go index 02e56f8..cbc1aa4 100644 --- a/consts.go +++ b/consts.go @@ -1,7 +1,7 @@ package main const ( - defaultConfigFilePath = "gron.conf" + defaultConfigFileName = "gron.conf" defaultOnSuccessMessageFmt = "Job {{.JobName}} finished." defaultOnErrorMessageFmt = "Job {{.JobName}} failed:\n\n{{.Error}}"