From 5a739b4c03a2edadf123eb669e4fadfacf9c6adc Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Fri, 8 Sep 2017 17:42:11 +0300 Subject: [PATCH] Fixes #403 --- src/nimble.nim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/nimble.nim b/src/nimble.nim index 883468a..a3d0096 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -615,15 +615,23 @@ proc listPaths(options: Options) = if kind != pcDir or not path.startsWith(options.getPkgsDir / name): continue - let - nimbleFile = path / name.addFileExt("nimble") - hasSpec = nimbleFile.existsFile + var nimbleFile = path / name.addFileExt("nimble") + var nimbleLinkTargetPath: string + if not nimbleFile.existsFile: + let nimbleLinkFile = path / name.addFileExt("nimble-link") + if fileExists(nimbleLinkFile): + let lns = readFile(nimbleLinkFile).splitLines() + nimbleFile = lns[0] + nimbleLinkTargetPath = lns[1] - if hasSpec: + if nimbleFile.existsFile: var pkgInfo = getPkgInfo(path, options) var v: VersionAndPath v.version = newVersion(pkgInfo.specialVersion) - v.path = options.getPkgsDir / (pkgInfo.name & '-' & pkgInfo.specialVersion) + if nimbleLinkTargetPath.len == 0: + v.path = options.getPkgsDir / (pkgInfo.name & '-' & pkgInfo.specialVersion) + else: + v.path = nimbleLinkTargetPath installed.add(v) else: display("Warning:", "No .nimble file found for " & path, Warning,