The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/cmd/grafana-cli/commands/remove_command.go

29 lines
545 B

package commands
import (
"context"
"errors"
"fmt"
"strings"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/utils"
)
func (cmd Command) removeCommand(c utils.CommandLine) error {
pluginID := c.Args().First()
if pluginID == "" {
return errors.New("missing plugin parameter")
}
err := uninstallPlugin(context.Background(), pluginID, c)
if err != nil {
if strings.Contains(err.Error(), "no such file or directory") {
return fmt.Errorf("plugin does not exist")
}
return err
} else {
logRestartNotice()
}
return nil
}