From 5a298c2fbdd47a148ae6c429ce92fbbc114d3ea4 Mon Sep 17 00:00:00 2001 From: merofuruya <80584154+MeroFuruya@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:08:48 +0200 Subject: [PATCH] fix [BUG] relative unit search paths need to prefix ..\ #146 --- utils/librarypath/librarypath.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/librarypath/librarypath.go b/utils/librarypath/librarypath.go index 63ea880..dbe61fe 100644 --- a/utils/librarypath/librarypath.go +++ b/utils/librarypath/librarypath.go @@ -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 }) @@ -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) }