Skip to content

Commit

Permalink
Merge pull request #147 from MeroFuruya/fix_146-relative-unit-search-…
Browse files Browse the repository at this point in the history
…paths

fix [BUG] relative unit search paths need to prefix ..\ #146
  • Loading branch information
viniciussanchez authored Feb 26, 2024
2 parents 19183e1 + 5a298c2 commit c7b74f5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/librarypath/librarypath.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func getNewPathsFromDir(path string, paths []string, fullPath bool, rootPath str
if !utils.Contains(paths, dir) {
paths = append(paths, dir)
}
// add ..\ prefixed path -> @MeroFuruya fix #146
prefixedPath := "..\\" + dir
if !utils.Contains(paths, prefixedPath) {
paths = append(paths, prefixedPath)
}
}
return nil
})
Expand All @@ -123,6 +128,14 @@ func getNewPathsFromDir(path string, paths []string, fullPath bool, rootPath str
if !utils.Contains(paths, path) {
paths = append(paths, path)
}
// prevent variables from being prefixed
if !strings.HasPrefix(path, "$") {
// add ..\ prefixed path -> @MeroFuruya fix #146
prefixedPath := "..\\" + path
if !utils.Contains(paths, prefixedPath) {
paths = append(paths, prefixedPath)
}
}
}
return cleanEmpty(paths)
}

0 comments on commit c7b74f5

Please sign in to comment.