Rename 'update' proc to 'refresh'.

This commit is contained in:
Dominik Picheta 2016-12-20 20:49:39 +01:00
commit ac352aa6b2

View file

@ -47,7 +47,7 @@ proc promptCustom(question, default: string): string =
if user == "": return default if user == "": return default
else: return user else: return user
proc update(options: Options) = proc refresh(options: Options) =
## Downloads the package list from the specified URL. ## Downloads the package list from the specified URL.
## ##
## If the download is not successful, an exception is raised. ## If the download is not successful, an exception is raised.
@ -547,15 +547,15 @@ proc getDownloadInfo*(pv: PkgTuple, options: Options,
if getPackage(pv.name, options, pkg): if getPackage(pv.name, options, pkg):
return (pkg.downloadMethod.getDownloadMethod(), pkg.url) return (pkg.downloadMethod.getDownloadMethod(), pkg.url)
else: else:
# If package is not found give the user a chance to update # If package is not found give the user a chance to refresh
# package.json # package.json
if doPrompt and if doPrompt and
options.prompt(pv.name & " not found in any local packages.json, " & options.prompt(pv.name & " not found in any local packages.json, " &
"check internet for updated packages?"): "check internet for updated packages?"):
update(options) refresh(options)
# Once we've updated, try again, but don't prompt if not found # Once we've refreshed, try again, but don't prompt if not found
# (as we've already updated and a failure means it really # (as we've already refreshed and a failure means it really
# isn't there) # isn't there)
return getDownloadInfo(pv, options, false) return getDownloadInfo(pv, options, false)
else: else:
@ -572,7 +572,7 @@ proc install(packages: seq[PkgTuple],
if doPrompt and if doPrompt and
options.prompt("No local packages.json found, download it from " & options.prompt("No local packages.json found, download it from " &
"internet?"): "internet?"):
update(options) refresh(options)
else: else:
quit("Please run nimble refresh.", QuitFailure) quit("Please run nimble refresh.", QuitFailure)
@ -936,7 +936,7 @@ proc doAction(options: Options) =
return return
case options.action.typ case options.action.typ
of actionRefresh: of actionRefresh:
update(options) refresh(options)
of actionInstall: of actionInstall:
let (_, pkgInfo) = install(options.action.packages, options) let (_, pkgInfo) = install(options.action.packages, options)
if options.action.packages.len == 0: if options.action.packages.len == 0: