Merge pull request #13269 from DanCech/pluginUpgrade

use pluginName consistently when upgrading plugins
This commit is contained in:
Carl Bergquist 2018-09-14 09:35:58 +02:00 committed by GitHub
commit 047fb770c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ func upgradeCommand(c CommandLine) error {
return err
}
v, err2 := s.GetPlugin(localPlugin.Id, c.RepoDirectory())
v, err2 := s.GetPlugin(pluginName, c.RepoDirectory())
if err2 != nil {
return err2
@ -24,9 +24,9 @@ func upgradeCommand(c CommandLine) error {
if ShouldUpgrade(localPlugin.Info.Version, v) {
s.RemoveInstalledPlugin(pluginsDir, pluginName)
return InstallPlugin(localPlugin.Id, "", c)
return InstallPlugin(pluginName, "", c)
}
logger.Infof("%s %s is up to date \n", color.GreenString("✔"), localPlugin.Id)
logger.Infof("%s %s is up to date \n", color.GreenString("✔"), pluginName)
return nil
}

View File

@ -63,7 +63,7 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
var data m.PluginRepo
err = json.Unmarshal(body, &data)
if err != nil {
logger.Info("Failed to unmarshal graphite response error:", err)
logger.Info("Failed to unmarshal plugin repo response error:", err)
return m.PluginRepo{}, err
}
@ -140,7 +140,7 @@ func GetPlugin(pluginId, repoUrl string) (m.Plugin, error) {
var data m.Plugin
err = json.Unmarshal(body, &data)
if err != nil {
logger.Info("Failed to unmarshal graphite response error:", err)
logger.Info("Failed to unmarshal plugin repo response error:", err)
return m.Plugin{}, err
}