Fix nim v1.2
This commit is contained in:
parent
7329b0d9f8
commit
642dd2f78c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue