Skip to content

Commit 2e04fbe

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/loader/loader.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ 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+
filePath := name
76+
if !filepath.IsAbs(name) {
77+
filePath = filepath.Join(base.Path, name)
78+
}
7679

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

0 commit comments

Comments
 (0)