Skip to content

Commit 64948b6

Browse files
committed
Fix nimble run with only one namedBin
1 parent 6b37ba7 commit 64948b6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

readme.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,11 @@ file is created instead.
871871
The binary can be named differently than the source file with the ``namedBin``
872872
table:
873873

874+
The keys in ``namedBin`` are Nim source filenames (without extension), and the values are executable names.
875+
874876
```nim
875-
namedBin["main"] = "mymain"
876-
namedBin = {"main": "mymain", "main2": "other-main"}.toTable()
877+
namedBin["main"] = "package-name"
878+
namedBin = {"main": "package-name", "sourcename2": "other-main"}.toTable()
877879
```
878880

879881
Note that `namedBin` entries override duplicates in `bin`.

src/nimblepkg/options.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,9 @@ proc getCompilationBinary*(options: Options, pkgInfo: PackageInfo): Option[strin
740740
if optRunFile.get("").len > 0:
741741
optRunFile.get()
742742
elif pkgInfo.bin.len == 1:
743-
toSeq(pkgInfo.bin.values)[0]
743+
toSeq(pkgInfo.bin.keys)[0]
744744
else:
745-
""
745+
return none(string)
746746

747747
if runFile.len > 0:
748748
return some(runFile.changeFileExt(ExeExt))

0 commit comments

Comments
 (0)