Merge pull request #467 from shinriyo/patch-2

for a sense of unity.
This commit is contained in:
Dominik Picheta 2018-03-22 11:11:05 +00:00 committed by GitHub
commit 347b6b7ab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -723,8 +723,10 @@ proc init(options: Options) =
nimbleFile = pkgName.changeFileExt("nimble")
validatePackageName(nimbleFile.changeFileExt(""))
if existsFile(os.getCurrentDir() / nimbleFile):
raise newException(NimbleError, "Nimble file already exists.")
let nimbleFilePath = os.getCurrentDir() / nimbleFile
if existsFile(nimbleFilePath):
let errMsg = "Nimble file already exists: $#" % nimbleFilePath
raise newException(NimbleError, errMsg)
display("Using", "$# for new package name" % [pkgName.escape()],
priority = HighPriority)