Fix issue #597 - error if bin is a source file
This commit is contained in:
parent
be83dcdca9
commit
016f42c34a
4 changed files with 20 additions and 0 deletions
2
src/nimblepkg/packageparser.nim
Executable file → Normal file
2
src/nimblepkg/packageparser.nim
Executable file → Normal file
|
|
@ -253,6 +253,8 @@ proc readPackageInfoFromNimble(path: string; result: var PackageInfo) =
|
|||
result.installExt.add(ev.value.multiSplit)
|
||||
of "bin":
|
||||
for i in ev.value.multiSplit:
|
||||
if i.splitFile().ext == ".nim":
|
||||
raise newException(NimbleError, "`bin` entry should not be a source file: " & i)
|
||||
result.bin.add(i.addFileExt(ExeExt))
|
||||
of "backend":
|
||||
result.backend = ev.value.toLowerAscii()
|
||||
|
|
|
|||
12
tests/issue597/dummy.nimble
Normal file
12
tests/issue597/dummy.nimble
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "Author"
|
||||
description = "dummy"
|
||||
license = "MIT"
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.17.0"
|
||||
|
||||
bin = @["test.nim"]
|
||||
0
tests/issue597/test.nim
Normal file
0
tests/issue597/test.nim
Normal file
|
|
@ -585,6 +585,12 @@ test "can pass args with spaces to Nim (#351)":
|
|||
checkpoint output
|
||||
check exitCode == QuitSuccess
|
||||
|
||||
test "error if `bin` is a source file (#597)":
|
||||
cd "issue597":
|
||||
var (output, exitCode) = execNimble("build")
|
||||
check exitCode != QuitSuccess
|
||||
check output.contains("entry should not be a source file: test.nim")
|
||||
|
||||
suite "reverse dependencies":
|
||||
test "basic test":
|
||||
cd "revdep/mydep":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue