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}}"