This commit is contained in:
Yuriy Glukhov 2017-09-08 17:42:11 +03:00
commit 5a739b4c03

View file

@ -615,15 +615,23 @@ proc listPaths(options: Options) =
if kind != pcDir or not path.startsWith(options.getPkgsDir / name): if kind != pcDir or not path.startsWith(options.getPkgsDir / name):
continue continue
let var nimbleFile = path / name.addFileExt("nimble")
nimbleFile = path / name.addFileExt("nimble") var nimbleLinkTargetPath: string
hasSpec = nimbleFile.existsFile 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 pkgInfo = getPkgInfo(path, options)
var v: VersionAndPath var v: VersionAndPath
v.version = newVersion(pkgInfo.specialVersion) v.version = newVersion(pkgInfo.specialVersion)
if nimbleLinkTargetPath.len == 0:
v.path = options.getPkgsDir / (pkgInfo.name & '-' & pkgInfo.specialVersion) v.path = options.getPkgsDir / (pkgInfo.name & '-' & pkgInfo.specialVersion)
else:
v.path = nimbleLinkTargetPath
installed.add(v) installed.add(v)
else: else:
display("Warning:", "No .nimble file found for " & path, Warning, display("Warning:", "No .nimble file found for " & path, Warning,