feat: update single dependencies

The `update` command now takes dependency URI's like the `install`
command.

In contrast to `install`, `update` always pulls the latest version.
This commit is contained in:
sh0rez 2020-03-17 17:40:33 +01:00
parent cd5e2945d2
commit eeea4677d2
No known key found for this signature in database
GPG key ID: 87C71DF9F8181FF1
2 changed files with 29 additions and 13 deletions

View file

@ -52,10 +52,11 @@ func Main() int {
initCmd := a.Command(initActionName, "Initialize a new empty jsonnetfile")
installCmd := a.Command(installActionName, "Install all dependencies or install specific ones")
installCmd := a.Command(installActionName, "Install new dependencies. Existing ones are silently skipped")
installCmdURIs := installCmd.Arg("uris", "URIs to packages to install, URLs or file paths").Strings()
updateCmd := a.Command(updateActionName, "Update all dependencies.")
updateCmd := a.Command(updateActionName, "Update all or specific dependencies.")
updateCmdURIs := updateCmd.Arg("uris", "URIs to packages to update, URLs or file paths").Strings()
rewriteCmd := a.Command(rewriteActionName, "Automatically rewrite legacy imports to absolute ones")
@ -79,7 +80,7 @@ func Main() int {
case installCmd.FullCommand():
return installCommand(workdir, cfg.JsonnetHome, *installCmdURIs)
case updateCmd.FullCommand():
return updateCommand(workdir, cfg.JsonnetHome)
return updateCommand(workdir, cfg.JsonnetHome, *updateCmdURIs)
case rewriteCmd.FullCommand():
return rewriteCommand(workdir, cfg.JsonnetHome)
default: