From 0181253eea4ed5a47c37140c0533bc62d7f09e68 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 21 Dec 2017 12:28:05 +0100 Subject: fixes #6949 --- compiler/nimblecmd.nim | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'compiler') diff --git a/compiler/nimblecmd.nim b/compiler/nimblecmd.nim index 39c3a17e7..0f9e03352 100644 --- a/compiler/nimblecmd.nim +++ b/compiler/nimblecmd.nim @@ -28,6 +28,10 @@ proc newVersion*(ver: string): Version = proc isSpecial(ver: Version): bool = return ($ver).len > 0 and ($ver)[0] == '#' +proc isValidVersion(v: string): bool = + if v.len > 0: + if v[0] in {'#'} + Digits: return true + proc `<`*(ver: Version, ver2: Version): bool = ## This is synced from Nimble's version module. @@ -72,15 +76,23 @@ proc getPathVersion*(p: string): tuple[name, version: string] = result.name = p return + for i in sepIdx..