Fixed embedded nimscript imports (#17425)

This commit is contained in:
Jason Beetham 2021-03-27 18:43:24 -06:00 • committed by GitHub
commit d96469037e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -812,8 +812,9 @@ proc findModule*(conf: ConfigRef; modulename, currentModule: string): AbsoluteFi
for candidate in stdlibDirs: for candidate in stdlibDirs:
let path = (conf.libpath.string / candidate / stripped) let path = (conf.libpath.string / candidate / stripped)
if fileExists(path): if fileExists(path):
m = path result = AbsoluteFile path
break break
else: # If prefixed with std/ why would we add the current module path!
let currentPath = currentModule.splitFile.dir let currentPath = currentModule.splitFile.dir
result = AbsoluteFile currentPath / m result = AbsoluteFile currentPath / m
if not fileExists(result): if not fileExists(result):