Put sanitizePath in search()
This commit is contained in:
parent
5e3c0999e0
commit
6343567a91
4 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ template relativePath(path: untyped): untyped =
|
|||
path.multiReplace([(gOutput, ""), ("\\", "/"), ("//", "/")])
|
||||
|
||||
proc c2nim*(fl, outfile: string, c2nimConfig: c2nimConfigObj) =
|
||||
var file = search(fl).sanitizePath
|
||||
var file = search(fl)
|
||||
if file.len() == 0:
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ proc runPreprocess*(file, ppflags, flags: string, inline: bool): string =
|
|||
var
|
||||
rdata: Rope
|
||||
start = false
|
||||
sfile = file.replace("\\", "/")
|
||||
sfile = file.sanitizePath
|
||||
|
||||
if inline:
|
||||
sfile = sfile.parentDir()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os, ospaths, pegs, regex, strutils, tables
|
||||
|
||||
import globals
|
||||
import globals, external
|
||||
|
||||
# ###
|
||||
# File loction
|
||||
|
|
@ -44,7 +44,7 @@ proc search*(file: string): string =
|
|||
quit(1)
|
||||
|
||||
# Only keep relative directory
|
||||
return result.multiReplace([("\\", $DirSep), ("//", $DirSep), (gProjectDir & $DirSep, "")])
|
||||
return result.sanitizePath.replace(gProjectDir & "/", "")
|
||||
|
||||
proc rename*(file: string, renfile: string) =
|
||||
if file.splitFile().ext == ".nim":
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ proc getKey(ukey: string): tuple[key: string, val: bool] =
|
|||
proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, string]()) =
|
||||
var
|
||||
cfg = cfgin
|
||||
sfile = search(file).sanitizePath
|
||||
sfile = search(file)
|
||||
|
||||
if sfile in gDoneRecursive:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue