Fixes #304.
This commit is contained in:
parent
b629048249
commit
dda0c39e34
2 changed files with 12 additions and 6 deletions
|
|
@ -290,12 +290,14 @@ proc readPackageInfo(nf: NimbleFile, options: Options,
|
||||||
# By default specialVersion is the same as version.
|
# By default specialVersion is the same as version.
|
||||||
result.specialVersion = result.version
|
result.specialVersion = result.version
|
||||||
|
|
||||||
# The package directory name may include a "special" version
|
# Only attempt to read a special version if `nf` is inside the $nimbleDir.
|
||||||
# (example #head). If so, it is given higher priority and therefore
|
if nf.startsWith(options.getNimbleDir()):
|
||||||
# overwrites the .nimble file's version.
|
# The package directory name may include a "special" version
|
||||||
let version = parseVersionRange(minimalInfo.version)
|
# (example #head). If so, it is given higher priority and therefore
|
||||||
if version.kind == verSpecial:
|
# overwrites the .nimble file's version.
|
||||||
result.specialVersion = minimalInfo.version
|
let version = parseVersionRange(minimalInfo.version)
|
||||||
|
if version.kind == verSpecial:
|
||||||
|
result.specialVersion = minimalInfo.version
|
||||||
|
|
||||||
if not result.isMinimal:
|
if not result.isMinimal:
|
||||||
options.pkgInfoCache[nf] = result
|
options.pkgInfoCache[nf] = result
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ proc inLines(lines: seq[string], line: string): bool =
|
||||||
for i in lines:
|
for i in lines:
|
||||||
if line.normalize in i.normalize: return true
|
if line.normalize in i.normalize: return true
|
||||||
|
|
||||||
|
test "can distinguish package reading in nimbleDir vs. other dirs (#304)":
|
||||||
|
cd "issue304" / "package-test":
|
||||||
|
check execNimble("tasks").exitCode == QuitSuccess
|
||||||
|
|
||||||
test "can build with #head and versioned package (#289)":
|
test "can build with #head and versioned package (#289)":
|
||||||
cd "issue289":
|
cd "issue289":
|
||||||
check execNimble(["install", "-y"]).exitCode == QuitSuccess
|
check execNimble(["install", "-y"]).exitCode == QuitSuccess
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue