diff --git a/src/nim_lk.nim b/src/nim_lk.nim index df3f6e8..3cdf637 100644 --- a/src/nim_lk.nim +++ b/src/nim_lk.nim @@ -64,8 +64,8 @@ proc gitLsRemote(url: string; withTags: bool): seq[tuple[tag: string, rev: strin proc matchRev(url: string; wanted: VersionRange): tuple[tag: string, rev: string] = if wanted.kind == verSpecial: let special = string(wanted.spe) - if special.len == 41 and special[0] == '#': - result[1] = special[1..39] + if special[0] == '#': + result[1] = special[1..special.high] else: quit("unhandled version " & url & " " & $wanted) else: @@ -120,9 +120,7 @@ proc prefetchGit(uri: Uri; version: VersionRange): Preserve = var archiveUri = uri archiveUri.scheme = "https" archiveUri.path.removeSuffix ".git" - archiveUri.path.add "/archive/" - archiveUri.path.add rev - archiveUri.path.add ".tar.gz" + archiveUri.path = archiveUri.path / "archive"/ rev & ".tar.gz" let client = newHttpClient() defer: close(client) let