Skip to content

Commit 87e4c80

Browse files
committed
fix: respect absolute paths for loading local tools
Signed-off-by: Donnie Adams <[email protected]>
1 parent 6e92ee7 commit 87e4c80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/loader/loader.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ func openFile(path string) (io.ReadCloser, bool, error) {
7272

7373
func loadLocal(base *source, name string) (*source, bool, error) {
7474
// We want to keep all strings in / format, and only convert to platform specific when reading
75-
filePath := path.Join(base.Path, name)
75+
// This is why we use path instead of filepath.
76+
filePath := name
77+
if !path.IsAbs(name) {
78+
filePath = path.Join(base.Path, name)
79+
}
7680

7781
if s, err := fs.Stat(internal.FS, filepath.Clean(filePath)); err == nil && s.IsDir() {
7882
for _, def := range types.DefaultFiles {

0 commit comments

Comments
 (0)