Merge pull request #604 from alaviss/no-pkglist
config: don't error out if no package list found
This commit is contained in:
commit
e60ab12549
1 changed files with 6 additions and 5 deletions
|
|
@ -68,11 +68,12 @@ proc parseConfig*(): Config =
|
||||||
var e = next(p)
|
var e = next(p)
|
||||||
case e.kind
|
case e.kind
|
||||||
of cfgEof:
|
of cfgEof:
|
||||||
if currentPackageList.urls.len == 0 and currentPackageList.path == "":
|
if currentSection.len > 0:
|
||||||
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 != "":
|
raise newException(NimbleError, "Package list '$1' requires either url or path" % currentPackageList.name)
|
||||||
raise newException(NimbleError, "Attempted to specify `url` and `path` for the same package list '$1'" % currentPackageList.name)
|
if currentPackageList.urls.len > 0 and currentPackageList.path != "":
|
||||||
addCurrentPkgList(result, currentPackageList)
|
raise newException(NimbleError, "Attempted to specify `url` and `path` for the same package list '$1'" % currentPackageList.name)
|
||||||
|
addCurrentPkgList(result, currentPackageList)
|
||||||
break
|
break
|
||||||
of cfgSectionStart:
|
of cfgSectionStart:
|
||||||
addCurrentPkgList(result, currentPackageList)
|
addCurrentPkgList(result, currentPackageList)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue