Skip to content

Commit

Permalink
run project config.nims if exists, then inputfile.nims if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Aug 23, 2018
1 parent 25f5ea7 commit acd2ec8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
conf.projectPath = canonicalizePath(conf, getCurrentDir())
loadConfigs(DefaultConfig, cache, conf) # load all config files
let scriptFile = conf.projectFull.changeFileExt("nims")
if fileExists(conf.projectPath / "config.nims"):
# directory wide NimScript file
runNimScript(cache, conf.projectPath / "config.nims", freshDefines=false, conf)
if fileExists(scriptFile):
runNimScript(cache, scriptFile, freshDefines=false, conf)
# 'nim foo.nims' means to just run the NimScript file and do nothing more:
if scriptFile == conf.projectFull: return
elif fileExists(conf.projectPath / "config.nims"):
# directory wide NimScript file
runNimScript(cache, conf.projectPath / "config.nims", freshDefines=false, conf)
# now process command line arguments again, because some options in the
# command line can overwite the config file's settings
extccomp.initVars(conf)
Expand Down

0 comments on commit acd2ec8

Please sign in to comment.