mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech(cli): remove loop and head straight for plugindir
This commit is contained in:
@@ -75,9 +75,16 @@ func GetLocalPlugins(pluginDir string) []m.InstalledPlugin {
|
||||
return result
|
||||
}
|
||||
|
||||
func RemoveInstalledPlugin(pluginPath, id string) error {
|
||||
logger.Infof("Removing plugin: %v\n", id)
|
||||
return IoHelper.RemoveAll(path.Join(pluginPath, id))
|
||||
func RemoveInstalledPlugin(pluginPath, pluginName string) error {
|
||||
logger.Infof("Removing plugin: %v\n", pluginName)
|
||||
pluginDir := path.Join(pluginPath, pluginName)
|
||||
|
||||
_, err := IoHelper.Stat(pluginDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return IoHelper.RemoveAll(pluginDir)
|
||||
}
|
||||
|
||||
func GetPlugin(pluginId, repoUrl string) (m.Plugin, error) {
|
||||
|
||||
Reference in New Issue
Block a user