only replace the tilde when followed by a slash; refs #6176

This commit is contained in:
Araq
2017-09-03 01:08:23 +02:00
parent bad52ca29a
commit 2d8e97ee03

View File

@@ -290,8 +290,8 @@ proc pathSubs*(p, config: string): string =
"projectpath", options.gProjectPath,
"projectdir", options.gProjectPath,
"nimcache", getNimcacheDir()])
if '~' in result:
result = result.replace("~", home)
if "~/" in result:
result = result.replace("~/", home & '/')
proc toGeneratedFile*(path, ext: string): string =
## converts "/home/a/mymodule.nim", "rod" to "/home/a/nimcache/mymodule.rod"