From 14d8eca24b6d3faedbebb07922a955bc230486f6 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 24 Jun 2018 07:50:47 +0900 Subject: [PATCH] Change project dir based on nimgen cfg file --- nimgen.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nimgen.nim b/nimgen.nim index ee91e97..14e6692 100644 --- a/nimgen.nim +++ b/nimgen.nim @@ -5,7 +5,7 @@ var gDoneAfter: seq[string] = @[] gDoneInline: seq[string] = @[] - gProjectDir = getCurrentDir() + gProjectDir = "" gConfig: Config gFilter = "" gQuotes = true @@ -726,6 +726,8 @@ proc runCfg(cfg: string) = if not fileExists(cfg): raise newException(Exception, "Config doesn't exist: " & cfg) + gProjectDir = parentDir(cfg) + gConfig = loadConfig(cfg) if gConfig.hasKey("n.global"):