summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-14 10:54:31 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-14 10:54:31 +0200
commit0867c62ded73925b8cb2711559ce88e2a7a4a234 (patch)
tree2b357a23ae8f3e838e61443dddb4759851cf365c /compiler
parent6dddb3e68ef9209ea58ab44c8e226b05692e6289 (diff)
downloadNim-0867c62ded73925b8cb2711559ce88e2a7a4a234.tar.gz
patchFile: support properly
Diffstat (limited to 'compiler')
-rw-r--r--compiler/scriptconfig.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim
index 31a8f719a..833444788 100644
--- a/compiler/scriptconfig.nim
+++ b/compiler/scriptconfig.nim
@@ -16,7 +16,7 @@ import
   os, times, osproc, wordrecg, strtabs
 
 # we support 'cmpIgnoreStyle' natively for efficiency:
-from strutils import cmpIgnoreStyle
+from strutils import cmpIgnoreStyle, contains
 
 proc listDirs(a: VmArgs, filter: set[PathComponent]) =
   let dir = getString(a, 0)
@@ -125,8 +125,10 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
   cbconf patchFile:
     let key = a.getString(0) & "_" & a.getString(1)
     var val = a.getString(2).addFileExt(NimExt)
-    if not isAbsolute(val):
-      val = vthisDir / pathSubs(val, vthisDir)
+    if {'$', '~'} in val:
+      val = pathSubs(val, vthisDir)
+    elif not isAbsolute(val):
+      val = vthisDir / val
     gModuleOverrides[key] = val
 
 proc runNimScript*(scriptName: string; freshDefines=true) =