fix setCommand so it behaves like regular nim invocation (#18555)

This commit is contained in:
Timothee Cour 2021-07-21 23:00:29 -07:00 • committed by GitHub
commit d5b5827bc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 18 deletions

View file

@ -44,14 +44,7 @@ proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
elif self.supportsStdinFile and conf.projectName == "-":
handleStdinInput(conf)
elif conf.projectName != "":
try:
conf.projectFull = canonicalizePath(conf, AbsoluteFile conf.projectName)
except OSError:
conf.projectFull = AbsoluteFile conf.projectName
let p = splitFile(conf.projectFull)
let dir = if p.dir.isEmpty: AbsoluteDir getCurrentDir() else: p.dir
conf.projectPath = AbsoluteDir canonicalizePath(conf, AbsoluteFile dir)
conf.projectName = p.name
setFromProjectName(conf, conf.projectName)
else:
conf.projectPath = AbsoluteDir canonicalizePath(conf, AbsoluteFile getCurrentDir())