Terminate copy iteration when hitting in-place nimbleDir (#429)
* terminate copy iteration when hitting in-place nimbleDir; fixes #428 * investigate travis issue * more investigations * more investigations * fix nim version issue
This commit is contained in:
parent
0e09f69334
commit
209fca53e7
3 changed files with 19 additions and 2 deletions
|
|
@ -510,13 +510,13 @@ proc iterInstallFiles*(realDir: string, pkgInfo: PackageInfo,
|
||||||
for kind, file in walkDir(realDir):
|
for kind, file in walkDir(realDir):
|
||||||
if kind == pcDir:
|
if kind == pcDir:
|
||||||
let skip = pkgInfo.checkInstallDir(realDir, file)
|
let skip = pkgInfo.checkInstallDir(realDir, file)
|
||||||
|
|
||||||
if skip: continue
|
if skip: continue
|
||||||
|
# we also have to stop recursing if we reach an in-place nimbleDir
|
||||||
|
if file == options.getNimbleDir().expandFilename(): continue
|
||||||
|
|
||||||
iterInstallFiles(file, pkgInfo, options, action)
|
iterInstallFiles(file, pkgInfo, options, action)
|
||||||
else:
|
else:
|
||||||
let skip = pkgInfo.checkInstallFile(realDir, file)
|
let skip = pkgInfo.checkInstallFile(realDir, file)
|
||||||
|
|
||||||
if skip: continue
|
if skip: continue
|
||||||
|
|
||||||
action(file)
|
action(file)
|
||||||
|
|
|
||||||
10
tests/issue428/dummy.nimble
Normal file
10
tests/issue428/dummy.nimble
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Package
|
||||||
|
|
||||||
|
version = "0.1.0"
|
||||||
|
author = "Author"
|
||||||
|
description = "dummy"
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
|
||||||
|
requires "nim >= 0.17.0"
|
||||||
|
|
@ -354,6 +354,13 @@ test "issue #338":
|
||||||
cd "issue338":
|
cd "issue338":
|
||||||
check execNimble("install", "-y").exitCode == QuitSuccess
|
check execNimble("install", "-y").exitCode == QuitSuccess
|
||||||
|
|
||||||
|
test "issue #428":
|
||||||
|
cd "issue428":
|
||||||
|
# Note: Can't use execNimble because it patches nimbleDir
|
||||||
|
check execCmdEx(nimblePath & " -y --nimbleDir=./nimbleDir install").exitCode == QuitSuccess
|
||||||
|
check dirExists("nimbleDir/pkgs/dummy-0.1.0")
|
||||||
|
check(not dirExists("nimbleDir/pkgs/dummy-0.1.0/nimbleDir"))
|
||||||
|
|
||||||
test "can list":
|
test "can list":
|
||||||
check execNimble("list").exitCode == QuitSuccess
|
check execNimble("list").exitCode == QuitSuccess
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue