From 0867c62ded73925b8cb2711559ce88e2a7a4a234 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 14 Jul 2016 10:54:31 +0200 Subject: [PATCH] patchFile: support properly --- compiler/scriptconfig.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 31a8f719a6..833444788b 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) =