tech(cli): remove loop and head straight for plugindir

This commit is contained in:
bergquist
2016-06-25 01:18:49 +02:00
parent 07be2c89a3
commit af216ecf83
2 changed files with 19 additions and 10 deletions

View File

@@ -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) {