config: don't error out if no package list found

This commit is contained in:
Leorize 2019-01-20 15:53:06 +07:00
commit 4be5308941
No known key found for this signature in database
GPG key ID: 347D33895E6EA388

View file

@ -68,6 +68,7 @@ proc parseConfig*(): Config =
var e = next(p) var e = next(p)
case e.kind case e.kind
of cfgEof: of cfgEof:
if currentSection.len > 0:
if currentPackageList.urls.len == 0 and currentPackageList.path == "": if currentPackageList.urls.len == 0 and currentPackageList.path == "":
raise newException(NimbleError, "Package list '$1' requires either url or path" % currentPackageList.name) raise newException(NimbleError, "Package list '$1' requires either url or path" % currentPackageList.name)
if currentPackageList.urls.len > 0 and currentPackageList.path != "": if currentPackageList.urls.len > 0 and currentPackageList.path != "":