Commit 124b21a6 by Dan Cech

use pluginName consistently when upgrading plugins

parent 06855d2b
...@@ -16,7 +16,7 @@ func upgradeCommand(c CommandLine) error { ...@@ -16,7 +16,7 @@ func upgradeCommand(c CommandLine) error {
return err return err
} }
v, err2 := s.GetPlugin(localPlugin.Id, c.RepoDirectory()) v, err2 := s.GetPlugin(pluginName, c.RepoDirectory())
if err2 != nil { if err2 != nil {
return err2 return err2
...@@ -24,9 +24,9 @@ func upgradeCommand(c CommandLine) error { ...@@ -24,9 +24,9 @@ func upgradeCommand(c CommandLine) error {
if ShouldUpgrade(localPlugin.Info.Version, v) { if ShouldUpgrade(localPlugin.Info.Version, v) {
s.RemoveInstalledPlugin(pluginsDir, pluginName) 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 return nil
} }
...@@ -63,7 +63,7 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) { ...@@ -63,7 +63,7 @@ func ListAllPlugins(repoUrl string) (m.PluginRepo, error) {
var data m.PluginRepo var data m.PluginRepo
err = json.Unmarshal(body, &data) err = json.Unmarshal(body, &data)
if err != nil { 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 return m.PluginRepo{}, err
} }
...@@ -140,7 +140,7 @@ func GetPlugin(pluginId, repoUrl string) (m.Plugin, error) { ...@@ -140,7 +140,7 @@ func GetPlugin(pluginId, repoUrl string) (m.Plugin, error) {
var data m.Plugin var data m.Plugin
err = json.Unmarshal(body, &data) err = json.Unmarshal(body, &data)
if err != nil { 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 return m.Plugin{}, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment