Skip to content

Commit

Permalink
terminate copy iteration when hitting in-place nimbleDir; fixes nim-l…
Browse files Browse the repository at this point in the history
  • Loading branch information
bluenote10 committed Nov 12, 2017
1 parent f852198 commit 941a923
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nimblepkg/packageinfo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions tests/issue428/dummy.nimble
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Package

version = "0.1.0"
author = "Author"
description = "dummy"
license = "MIT"

# Dependencies

requires "nim >= 0.17.3"
6 changes: 6 additions & 0 deletions tests/tester.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 941a923

Please sign in to comment.