@@ -185,9 +185,9 @@ proc fetchList*(list: PackageList, options: Options) =
185
185
# Cache after first call
186
186
var
187
187
gPackageJson: Table[string , JsonNode]
188
- proc readPackageList(name: string , options: Options): JsonNode =
188
+ proc readPackageList(name: string , options: Options, ignorePackageCache = false ): JsonNode =
189
189
# If packages.json is not present ask the user if they want to download it.
190
- if gPackageJson.hasKey(name):
190
+ if ( not ignorePackageCache) and gPackageJson.hasKey(name):
191
191
return gPackageJson[name]
192
192
193
193
if needsRefresh(options):
@@ -204,7 +204,7 @@ proc readPackageList(name: string, options: Options): JsonNode =
204
204
name.toLowerAscii() & " .json" )
205
205
return gPackageJson[name]
206
206
207
- proc getPackage* (pkg: string , options: Options, resPkg: var Package): bool
207
+ proc getPackage* (pkg: string , options: Options, resPkg: var Package, ignorePackageCache = false ): bool
208
208
proc resolveAlias(pkg: Package, options: Options): Package =
209
209
result = pkg
210
210
# Resolve alias.
@@ -215,7 +215,7 @@ proc resolveAlias(pkg: Package, options: Options): Package =
215
215
raise nimbleError(" Alias for package not found: " &
216
216
pkg.alias)
217
217
218
- proc getPackage* (pkg: string , options: Options, resPkg: var Package): bool =
218
+ proc getPackage* (pkg: string , options: Options, resPkg: var Package, ignorePackageCache = false ): bool =
219
219
# # Searches any packages.json files defined in ``options.config.packageLists``
220
220
# # Saves the found package into ``resPkg``.
221
221
# #
@@ -226,7 +226,7 @@ proc getPackage*(pkg: string, options: Options, resPkg: var Package): bool =
226
226
# # Aliases are handled and resolved.
227
227
for name, list in options.config.packageLists:
228
228
display(" Reading" , " $1 package list" % name, priority = LowPriority)
229
- let packages = readPackageList(name, options)
229
+ let packages = readPackageList(name, options, ignorePackageCache )
230
230
for p in packages:
231
231
if normalize(p[" name" ].str) == normalize(pkg):
232
232
resPkg = p.fromJson()
0 commit comments