From 87e4c801e15fbef8722d60a9fb4ba8f07e60c1f5 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/loader/loader.go b/pkg/loader/loader.go index f60f09a1..d7634058 100644 --- a/pkg/loader/loader.go +++ b/pkg/loader/loader.go @@ -72,7 +72,11 @@ 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) + // This is why we use path instead of filepath. + filePath := name + if !path.IsAbs(name) { + filePath = path.Join(base.Path, name) + } if s, err := fs.Stat(internal.FS, filepath.Clean(filePath)); err == nil && s.IsDir() { for _, def := range types.DefaultFiles {