From 2e04fbe116a1582707cc2c215fec17006e0a4830 Mon Sep 17 00:00:00 2001 From: Donnie Adams Date: Tue, 16 Jul 2024 16:07:10 -0400 Subject: [PATCH] fix: respect absolute paths for loading local tools Signed-off-by: Donnie Adams --- pkg/loader/loader.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/loader/loader.go b/pkg/loader/loader.go index f60f09a1..339b4bdf 100644 --- a/pkg/loader/loader.go +++ b/pkg/loader/loader.go @@ -72,7 +72,10 @@ func openFile(path string) (io.ReadCloser, bool, error) { func loadLocal(base *source, name string) (*source, bool, error) { // We want to keep all strings in / format, and only convert to platform specific when reading - filePath := path.Join(base.Path, name) + filePath := name + if !filepath.IsAbs(name) { + filePath = filepath.Join(base.Path, name) + } if s, err := fs.Stat(internal.FS, filepath.Clean(filePath)); err == nil && s.IsDir() { for _, def := range types.DefaultFiles {