diff --git a/compiler/nim.nim b/compiler/nim.nim index 0b69a940e529b..9af642bccbaec 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -85,8 +85,14 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = if fileExists(scriptFile): runNimScript(cache, scriptFile, freshDefines=false, conf) - runNimScriptIfExists(getConfigDir() / "nim" / "config.nims") - runNimScriptIfExists(conf.projectPath / "config.nims") + # TODO: + # merge this complex logic with `loadConfigs` + # check whether these should be controlled via + # optSkipConfigFile, optSkipUserConfigFile + let config_nims = "config.nims" + runNimScriptIfExists(getSystemConfigPath(conf, config_nims)) + runNimScriptIfExists(getUserConfigPath(config_nims)) + runNimScriptIfExists(conf.projectPath / config_nims) block: let scriptFile = conf.projectFull.changeFileExt("nims") runNimScriptIfExists(scriptFile) diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index 1a8a0acb5bcb0..d26ed5deb6ea2 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -219,10 +219,10 @@ proc readConfigFile( closeLexer(L) return true -proc getUserConfigPath(filename: string): string = +proc getUserConfigPath*(filename: string): string = result = joinPath([getConfigDir(), "nim", filename]) -proc getSystemConfigPath(conf: ConfigRef; filename: string): string = +proc getSystemConfigPath*(conf: ConfigRef; filename: string): string = # try standard configuration file (installation did not distribute files # the UNIX way) let p = getPrefixDir(conf)