diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2018-07-13 00:19:50 -0500 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2018-07-13 00:19:50 -0500 |
| commit | e46d3b2332d439cda073a34947cdaa803926e948 (patch) | |
| tree | 223a22686d6f1b98548fcdf060bf4bd922affb62 /src | |
| parent | 7d60e2eea78169d7237594f6ab77ed02c968acc3 (diff) | |
| download | nimgen-e46d3b2332d439cda073a34947cdaa803926e948.tar.gz nimgen-e46d3b2332d439cda073a34947cdaa803926e948.zip | |
Implement #7 - [n.sourcefile] section, add nimclipboard
Diffstat (limited to 'src')
| -rw-r--r-- | src/nimgen/runcfg.nim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nimgen/runcfg.nim b/src/nimgen/runcfg.nim index 96e067e..cc48c01 100644 --- a/src/nimgen/runcfg.nim +++ b/src/nimgen/runcfg.nim @@ -19,15 +19,15 @@ proc getKey(ukey: string): tuple[key: string, val: bool] = return (kv[0], false) -proc runFile*(file: string, cfgin: OrderedTableRef) = +proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, string]()) = var cfg = cfgin sfile = search(file) for pattern in gWildcards.keys(): - var match: RegexMatch + var m: RegexMatch let pat = pattern.replace(".", "\\.").replace("*", ".*").replace("?", ".?") - if file.find(toPattern(pat), match): + if file.find(toPattern(pat), m): echo "Appending " & file & " " & pattern for key in gWildcards[pattern].keys(): cfg[key & "." & pattern] = gWildcards[pattern][key] @@ -224,7 +224,12 @@ proc runCfg*(cfg: string) = "n.prepare", "n.wildcard", "n.post"]: continue - runFile(file, gConfig[file]) + if file == "n.sourcefile": + for pattern in gConfig["n.sourcefile"].keys(): + for file in walkFiles(pattern.addEnv): + runFile(file) + else: + runFile(file, gConfig[file]) if gConfig.hasKey("n.post"): for post in gConfig["n.post"].keys(): |
