patchFile: support properly
This commit is contained in:
parent
6dddb3e68e
commit
0867c62ded
1 changed files with 5 additions and 3 deletions
|
|
@ -16,7 +16,7 @@ import
|
||||||
os, times, osproc, wordrecg, strtabs
|
os, times, osproc, wordrecg, strtabs
|
||||||
|
|
||||||
# we support 'cmpIgnoreStyle' natively for efficiency:
|
# we support 'cmpIgnoreStyle' natively for efficiency:
|
||||||
from strutils import cmpIgnoreStyle
|
from strutils import cmpIgnoreStyle, contains
|
||||||
|
|
||||||
proc listDirs(a: VmArgs, filter: set[PathComponent]) =
|
proc listDirs(a: VmArgs, filter: set[PathComponent]) =
|
||||||
let dir = getString(a, 0)
|
let dir = getString(a, 0)
|
||||||
|
|
@ -125,8 +125,10 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext =
|
||||||
cbconf patchFile:
|
cbconf patchFile:
|
||||||
let key = a.getString(0) & "_" & a.getString(1)
|
let key = a.getString(0) & "_" & a.getString(1)
|
||||||
var val = a.getString(2).addFileExt(NimExt)
|
var val = a.getString(2).addFileExt(NimExt)
|
||||||
if not isAbsolute(val):
|
if {'$', '~'} in val:
|
||||||
val = vthisDir / pathSubs(val, vthisDir)
|
val = pathSubs(val, vthisDir)
|
||||||
|
elif not isAbsolute(val):
|
||||||
|
val = vthisDir / val
|
||||||
gModuleOverrides[key] = val
|
gModuleOverrides[key] = val
|
||||||
|
|
||||||
proc runNimScript*(scriptName: string; freshDefines=true) =
|
proc runNimScript*(scriptName: string; freshDefines=true) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue