fixes 'e' command handling; now only does what advopt.txt claims it does (#11961)

* fixes 'e' command handling; now only does what advopt.txt claims it does
* address Timothee's remark
This commit is contained in:
Andreas Rumpf 2019-08-16 18:19:30 +02:00 • committed by GitHub
commit 15e681ce66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View file

@ -13,6 +13,8 @@ import
options, idents, nimconf, scriptconfig, extccomp, commands, msgs,
lineinfos, modulegraphs, condsyms, os, pathutils
from strutils import normalize
type
NimProg* = ref object
suggestMode*: bool
@ -72,7 +74,11 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi
runNimScriptIfExists(scriptFile)
# 'nim foo.nims' means to just run the NimScript file and do nothing more:
if fileExists(scriptFile) and scriptFile == conf.projectFull:
return false
if conf.command == "":
conf.command = "e"
return false
elif conf.command.normalize == "e":
return false
else:
if scriptFile != conf.projectFull:
runNimScriptIfExists(scriptFile)