make config.nims behave like nim.cfg in terms of where these scripts are searched / run (#8682)

* run project config.nims if exists, then inputfile.nims if exists
* ~/.config/nim/config.nims can now be used
* also check in getSystemConfigPath for config.nims
* refactor handleCmdLine for nim and nimsuggest
This commit is contained in:
Timothee Cour
2018-08-30 04:52:32 -07:00
committed by Andreas Rumpf
parent 01211ced1d
commit ed0cb7b85d
7 changed files with 152 additions and 114 deletions

View File

@@ -171,7 +171,7 @@ proc runNimScript*(cache: IdentCache; scriptName: string;
incl(m.flags, sfMainModule)
graph.vm = setupVM(m, cache, scriptName, graph)
graph.compileSystemModule()
graph.compileSystemModule() # TODO: see why this unsets hintConf in conf.notes
discard graph.processModule(m, llStreamOpen(scriptName, fmRead))
# ensure we load 'system.nim' again for the real non-config stuff!