mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 01:32:08 +08:00
change(grafana-cli): changed upgrade to update in command line, upgrade and upgrade-all will still work as aliases
This commit is contained in:
@ -28,14 +28,14 @@ List installed plugins
|
|||||||
grafana-cli plugins ls
|
grafana-cli plugins ls
|
||||||
```
|
```
|
||||||
|
|
||||||
Upgrade all installed plugins
|
Update all installed plugins
|
||||||
```
|
```
|
||||||
grafana-cli plugins upgrade-all
|
grafana-cli plugins update-all
|
||||||
```
|
```
|
||||||
|
|
||||||
Upgrade one plugin
|
Update one plugin
|
||||||
```
|
```
|
||||||
grafana-cli plugins upgrade <plugin-id>
|
grafana-cli plugins update <plugin-id>
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove one plugin
|
Remove one plugin
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
|
"github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func runCommand(command func(commandLine CommandLine) error) func(context *cli.Context) {
|
func runCommand(command func(commandLine CommandLine) error) func(context *cli.Context) {
|
||||||
@ -32,13 +33,15 @@ var pluginCommands = []cli.Command{
|
|||||||
Usage: "list remote available plugins",
|
Usage: "list remote available plugins",
|
||||||
Action: runCommand(listremoteCommand),
|
Action: runCommand(listremoteCommand),
|
||||||
}, {
|
}, {
|
||||||
Name: "upgrade",
|
Name: "update",
|
||||||
Usage: "upgrade <plugin id>",
|
Usage: "update <plugin id>",
|
||||||
Action: runCommand(upgradeCommand),
|
Aliases: []string{"upgrade"},
|
||||||
|
Action: runCommand(upgradeCommand),
|
||||||
}, {
|
}, {
|
||||||
Name: "upgrade-all",
|
Name: "update-all",
|
||||||
Usage: "upgrades all your installed plugins",
|
Aliases: []string{"upgrade-all"},
|
||||||
Action: runCommand(upgradeAllCommand),
|
Usage: "update all your installed plugins",
|
||||||
|
Action: runCommand(upgradeAllCommand),
|
||||||
}, {
|
}, {
|
||||||
Name: "ls",
|
Name: "ls",
|
||||||
Usage: "list all installed plugins",
|
Usage: "list all installed plugins",
|
||||||
|
@ -51,7 +51,7 @@ func upgradeAllCommand(c CommandLine) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, p := range pluginsToUpgrade {
|
for _, p := range pluginsToUpgrade {
|
||||||
log.Infof("Upgrading %v \n", p.Id)
|
log.Infof("Updating %v \n", p.Id)
|
||||||
|
|
||||||
s.RemoveInstalledPlugin(pluginsDir, p.Id)
|
s.RemoveInstalledPlugin(pluginsDir, p.Id)
|
||||||
InstallPlugin(p.Id, "", c)
|
InstallPlugin(p.Id, "", c)
|
||||||
|
Reference in New Issue
Block a user