Merge pull request #31 from jyapayne/fix_another_issue

Fix windows not processing headers
This commit is contained in:
genotrance 2018-07-18 09:28:10 -05:00 committed by GitHub
commit dc9943a22c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -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()

View file

@ -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":

View file

@ -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
@ -161,13 +161,13 @@ proc runCfg*(cfg: string) =
echo "Config doesn't exist: " & cfg
quit(1)
gProjectDir = parentDir(cfg.expandFilename())
gProjectDir = parentDir(cfg.expandFilename()).sanitizePath
gConfig = loadConfig(cfg)
if gConfig.hasKey("n.global"):
if gConfig["n.global"].hasKey("output"):
gOutput = gConfig["n.global"]["output"]
gOutput = gConfig["n.global"]["output"].sanitizePath
if dirExists(gOutput):
if "-f" in commandLineParams():
try:
@ -207,11 +207,11 @@ proc runCfg*(cfg: string) =
if gConfig.hasKey("n.include"):
for inc in gConfig["n.include"].keys():
gIncludes.add(inc.addEnv())
gIncludes.add(inc.addEnv().sanitizePath)
if gConfig.hasKey("n.exclude"):
for excl in gConfig["n.exclude"].keys():
gExcludes.add(excl.addEnv())
gExcludes.add(excl.addEnv().sanitizePath)
if gConfig.hasKey("n.prepare"):
for prep in gConfig["n.prepare"].keys():