diff options
Diffstat (limited to 'compiler/scriptconfig.nim')
-rw-r--r-- | compiler/scriptconfig.nim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 8499ebd98..22cd282fd 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -105,6 +105,13 @@ proc setupVM*(module: PSym; scriptName: string): PEvalContext = setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1)) cbconf setCommand: options.command = a.getString 0 + let arg = a.getString 1 + if arg.len > 0: + gProjectName = arg + try: + gProjectFull = canonicalizePath(gProjectPath / gProjectName) + except OSError: + gProjectFull = gProjectName cbconf getCommand: setResult(a, options.command) cbconf switch: @@ -133,4 +140,7 @@ proc runNimScript*(scriptName: string) = # ensure we load 'system.nim' again for the real non-config stuff! resetAllModulesHard() vm.globalCtx = nil - initDefines() + # do not remove the defined symbols + #initDefines() + undefSymbol("nimscript") + undefSymbol("nimconfig") |