mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-20 07:51:32 +00:00
patchFile: support properly
This commit is contained in:
@@ -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) =
|
||||
|
||||
Reference in New Issue
Block a user