Tests for the existence of project.nim file

Matches nim's command line handling of 'nim c project'
The error message also states the files being tested.
This commit is contained in:
Xiao-Yong Jin 2017-10-23 15:51:32 -05:00
commit 8ca1cc0957

View file

@ -498,12 +498,15 @@ proc build(options: Options) =
buildFromDir(pkgInfo, paths, args)
proc execBackend(options: Options) =
let bin = options.action.file
let
bin = options.action.file
binDotNim = bin.addFileExt("nim")
if bin == "":
raise newException(NimbleError, "You need to specify a file.")
if not fileExists(bin):
raise newException(NimbleError, "Specified file does not exist.")
if not (fileExists(bin) or fileExists(binDotNim)):
raise newException(NimbleError,
"Specified file, " & bin & " or " & binDotNim & ", does not exist.")
var pkgInfo = getPkgInfo(getCurrentDir(), options)
nimScriptHint(pkgInfo)