fix #16526 run config.nims before foo.nim.cfg (#16557)

* fix #16526 run config.nims before foo.nim.cfg

* add test
This commit is contained in:
Timothee Cour 2021-01-02 12:41:44 -08:00 • committed by GitHub
commit 471aab86a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 2 deletions

View file

@ -281,6 +281,8 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
if optSkipProjConfigFile notin conf.globalOptions:
readConfigFile(pd / cfg)
if cfg == DefaultConfig:
runNimScriptIfExists(pd / DefaultConfigNims)
if conf.projectName.len != 0:
# new project wide config file:
@ -289,8 +291,6 @@ proc loadConfigs*(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef; idgen:
projectConfig = changeFileExt(conf.projectFull, "nim.cfg")
readConfigFile(projectConfig)
if cfg == DefaultConfig:
runNimScriptIfExists(pd / DefaultConfigNims)
let scriptFile = conf.projectFull.changeFileExt("nims")
let scriptIsProj = scriptFile == conf.projectFull