Change project dir based on nimgen cfg file

This commit is contained in:
Joey Yakimowich-Payne 2018-06-24 07:50:47 +09:00
commit 14d8eca24b

View file

@ -5,7 +5,7 @@ var
gDoneAfter: seq[string] = @[] gDoneAfter: seq[string] = @[]
gDoneInline: seq[string] = @[] gDoneInline: seq[string] = @[]
gProjectDir = getCurrentDir() gProjectDir = ""
gConfig: Config gConfig: Config
gFilter = "" gFilter = ""
gQuotes = true gQuotes = true
@ -726,6 +726,8 @@ proc runCfg(cfg: string) =
if not fileExists(cfg): if not fileExists(cfg):
raise newException(Exception, "Config doesn't exist: " & cfg) raise newException(Exception, "Config doesn't exist: " & cfg)
gProjectDir = parentDir(cfg)
gConfig = loadConfig(cfg) gConfig = loadConfig(cfg)
if gConfig.hasKey("n.global"): if gConfig.hasKey("n.global"):