Package names are case insensitive (#190)

This commit is contained in:
Aidan Steele 2016-04-10 19:42:56 +10:00
commit 8abf18633d

View file

@ -142,7 +142,7 @@ proc getPackage*(pkg: string, options: Options,
let packages = parseFile(options.getNimbleDir() /
"packages_" & name.toLower() & ".json")
for p in packages:
if p["name"].str == pkg:
if normalize(p["name"].str) == normalize(pkg):
resPkg = p.fromJson()
return true
@ -302,4 +302,4 @@ when isMainModule:
doAssert toValidPackageName("foo__bar") == "foo_bar"
doAssert toValidPackageName("jhbasdh!£$@%#^_&*_()qwe") == "jhbasdh_qwe"
echo("All tests passed!")
echo("All tests passed!")