Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix [BUG] relative unit search paths need to prefix ..\ #146 #147

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}