diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index 929587b8..0428d2aa 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -510,13 +510,13 @@ proc iterInstallFiles*(realDir: string, pkgInfo: PackageInfo, for kind, file in walkDir(realDir): if kind == pcDir: let skip = pkgInfo.checkInstallDir(realDir, file) - 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) else: let skip = pkgInfo.checkInstallFile(realDir, file) - if skip: continue action(file) diff --git a/tests/issue428/dummy.nimble b/tests/issue428/dummy.nimble new file mode 100644 index 00000000..dec76c1b --- /dev/null +++ b/tests/issue428/dummy.nimble @@ -0,0 +1,10 @@ +# Package + +version = "0.1.0" +author = "Author" +description = "dummy" +license = "MIT" + +# Dependencies + +requires "nim >= 0.17.3" \ No newline at end of file diff --git a/tests/tester.nim b/tests/tester.nim index d780f40d..fdd569ca 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -354,6 +354,12 @@ test "issue #338": cd "issue338": 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") + test "can list": check execNimble("list").exitCode == QuitSuccess