From 06ae14a000fcc9c684b0208ce01a5654c8c43987 Mon Sep 17 00:00:00 2001 From: sisisin Date: Fri, 20 Jan 2023 18:10:30 +0900 Subject: [PATCH] fix: support abs path on config flag --- pkg/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/config.go b/pkg/config.go index 1135c22..85c85fc 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -41,7 +41,12 @@ func validConfigPathOrExit(configPathFromArg string) string { return configFile } else { - configFile := filepath.Join(wd, configPathFromArg) + configFile := "" + if path.IsAbs(configPathFromArg) { + configFile = configPathFromArg + } else { + configFile = filepath.Join(wd, configPathFromArg) + } if fileExists(configFile) { return configFile }