mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
grafana-cli: Upgrade to urfave/cli v2 (#22402)
* grafana-cli: Upgrade to urfave/cli v2
This commit is contained in:
@@ -11,19 +11,19 @@ import (
|
||||
|
||||
var removePlugin func(pluginPath, id string) error = services.RemoveInstalledPlugin
|
||||
|
||||
func removeCommand(c utils.CommandLine) error {
|
||||
func (cmd Command) removeCommand(c utils.CommandLine) error {
|
||||
pluginPath := c.PluginDirectory()
|
||||
|
||||
plugin := c.Args().First()
|
||||
if plugin == "" {
|
||||
return errors.New("Missing plugin parameter")
|
||||
return errors.New("missing plugin parameter")
|
||||
}
|
||||
|
||||
err := removePlugin(pluginPath, plugin)
|
||||
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "no such file or directory") {
|
||||
return fmt.Errorf("Plugin does not exist")
|
||||
return fmt.Errorf("plugin does not exist")
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user