fix(cli): improve error message for upgrade-all

closes #5885
This commit is contained in:
bergquist 2016-08-30 13:47:42 +02:00
parent b55b7cde4b
commit 645293e590
2 changed files with 11 additions and 3 deletions

View File

@ -14,7 +14,7 @@ func runCommand(command func(commandLine CommandLine) error) func(context *cli.C
cmd := &contextCommandLine{context}
if err := command(cmd); err != nil {
logger.Errorf("\n%s: ", color.RedString("Error"))
logger.Errorf("%s\n\n", err)
logger.Errorf("%s %s\n\n", color.RedString("✗"), err)
cmd.ShowHelp()
os.Exit(1)

View File

@ -53,8 +53,16 @@ func upgradeAllCommand(c CommandLine) error {
for _, p := range pluginsToUpgrade {
logger.Infof("Updating %v \n", p.Id)
s.RemoveInstalledPlugin(pluginsDir, p.Id)
InstallPlugin(p.Id, "", c)
var err error
err = s.RemoveInstalledPlugin(pluginsDir, p.Id)
if err != nil {
return err
}
err = InstallPlugin(p.Id, "", c)
if err != nil {
return err
}
}
return nil