Don't fail immediately when user doesn't want to load packages.json.

This commit is contained in:
Dominik Picheta 2017-08-16 22:20:24 +01:00
commit 5f1de1e4ff

View file

@ -227,7 +227,9 @@ proc readPackageList(name: string, options: Options): JsonNode =
for name, list in options.config.packageLists: for name, list in options.config.packageLists:
fetchList(list, options) fetchList(list, options)
else: else:
raise newException(NimbleError, "Please run nimble refresh.") # The user might not need a package list for now. So let's try
# going further.
return newJArray()
return parseFile(options.getNimbleDir() / "packages_" & return parseFile(options.getNimbleDir() / "packages_" &
name.toLowerAscii() & ".json") name.toLowerAscii() & ".json")