aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Yakimowich-Payne <jyapayne@gmail.com>2018-06-24 07:50:47 +0900
committerJoey Yakimowich-Payne <jyapayne@gmail.com>2018-06-24 07:50:47 +0900
commit2f2b26d269ba690ffe90708d1cb16f415cc673cb (patch)
tree8a29248dc303a45aabf3e37e68c49a180aa0c1c0
parent71699332be05b7a5aed93c4d9d80c4333f7692c3 (diff)
downloadnimgen-2f2b26d269ba690ffe90708d1cb16f415cc673cb.tar.gz
nimgen-2f2b26d269ba690ffe90708d1cb16f415cc673cb.zip
Change project dir based on nimgen cfg file
-rw-r--r--nimgen.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/nimgen.nim b/nimgen.nim
index e601153..14ece01 100644
--- a/nimgen.nim
+++ b/nimgen.nim
@@ -4,7 +4,7 @@ var
gDoneRecursive: seq[string] = @[]
gDoneInline: seq[string] = @[]
- gProjectDir = getCurrentDir()
+ gProjectDir = ""
gConfig: Config
gFilter = ""
gQuotes = true
@@ -651,6 +651,8 @@ proc runCfg(cfg: string) =
echo "Config doesn't exist: " & cfg
quit(1)
+ gProjectDir = parentDir(cfg)
+
gConfig = loadConfig(cfg)
if gConfig.hasKey("n.global"):