diff --git a/libp2p.nimble b/libp2p.nimble index f00bdf7e1..2644f6fef 100644 --- a/libp2p.nimble +++ b/libp2p.nimble @@ -128,7 +128,7 @@ task pin, "Create a lockfile": exec "nim c -r tools/pinner.nim" import sequtils -import os, json +import os task install_pinned, "Reads the lockfile": let toInstall = readFile(PinFile).splitWhitespace().mapIt((it.split(";", 1)[0], it.split(";", 1)[1])) # [('packageName', 'packageFullUri')] @@ -145,17 +145,13 @@ task install_pinned, "Reads the lockfile": for dependency in listDirs(nimblePkgs): let fileName = dependency.extractFilename - jsonContent = parseJson(readFile(dependency & "/nimblemeta.json")) - fileContent = - if "metaData" in jsonContent: jsonContent["metaData"] - else: jsonContent + fileContent = readFile(dependency & "/nimblemeta.json") packageName = fileName.split('-')[0] - version = fileContent.getOrDefault("vcsRevision").getStr("") if toInstall.anyIt( it[0] == packageName and ( - it[1].split('#')[^1] == version or # nimble for nim 2.X + it[1].split('#')[^1] in fileContent or # nimble for nim 2.X fileName.endsWith(it[1].split('#')[^1]) # nimble for nim 1.X ) ) == false or