diff --git a/src/nimble.nim b/src/nimble.nim index 293d846..30ae15d 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -90,8 +90,16 @@ proc refresh(options: Options) = display("Success", "Package list downloaded.", Success, HighPriority) break - if parameter.isUrl: - downloadList(PackageList(name: "commandline", urls: @[parameter]), options) + if parameter.len > 0: + if parameter.isUrl: + let cmdLine = PackageList(name: "commandline", urls: @[parameter]) + downloadList(cmdLine, options) + else: + if parameter notin options.config.packageLists: + let msg = "Package list with the specified name not found." + raise newException(NimbleError, msg) + + downloadList(options.config.packageLists[parameter], options) else: # Try each package list in config for name, list in options.config.packageLists: diff --git a/src/nimblepkg/config.nim b/src/nimblepkg/config.nim index 3daf952..8b42f5e 100644 --- a/src/nimblepkg/config.nim +++ b/src/nimblepkg/config.nim @@ -8,7 +8,7 @@ type Config* = object nimbleDir*: string chcp*: bool # Whether to change the code page in .cmd files on Win. - packageLists*: Table[string, PackageList] ## URLs to packages.json files + packageLists*: Table[string, PackageList] ## Names -> packages.json files cloneUsingHttps*: bool # Whether to replace git:// for https:// httpProxy*: Uri # Proxy for package list downloads.