fix setCommand so it behaves like regular nim invocation (#18555)
This commit is contained in:
parent
01fc9e58ca
commit
d5b5827bc2
3 changed files with 12 additions and 18 deletions
|
|
@ -151,18 +151,9 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string;
|
|||
setResult(a, strutils.cmpIgnoreCase(a.getString 0, a.getString 1))
|
||||
cbconf setCommand:
|
||||
conf.setCommandEarly(a.getString 0)
|
||||
# xxx move remaining logic to commands.nim or other
|
||||
let arg = a.getString 1
|
||||
incl(conf.globalOptions, optWasNimscript)
|
||||
if arg.len > 0:
|
||||
conf.projectName = arg
|
||||
let path =
|
||||
if conf.projectName.isAbsolute: AbsoluteFile(conf.projectName)
|
||||
else: conf.projectPath / RelativeFile(conf.projectName)
|
||||
try:
|
||||
conf.projectFull = canonicalizePath(conf, path)
|
||||
except OSError:
|
||||
conf.projectFull = path
|
||||
if arg.len > 0: setFromProjectName(conf, arg)
|
||||
cbconf getCommand:
|
||||
setResult(a, conf.command)
|
||||
cbconf switch:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue