New plugin warning extended with instructions
@@ -11,6 +11,7 @@ import (
"github.com/bitrise-io/bitrise/tools"
"github.com/bitrise-io/bitrise/version"
envmanModels "github.com/bitrise-io/envman/models"
+ flog "github.com/bitrise-io/go-utils/log"
"github.com/bitrise-io/go-utils/pathutil"
)
@@ -73,6 +74,14 @@ func RunPluginByCommand(plugin Plugin, args []string) error {
return runPlugin(plugin, args, pluginInput)
}
+func printPluginUpdateInfos(newVersion string, plugin Plugin) {
+ flog.Warnf("")
+ flog.Warnf("New version (%s) of plugin (%s) available", newVersion, plugin.Name)
+ flog.Printf("Run command to update plugin:")
+ fmt.Println()
+ flog.Donef("$ bitrise plugin update workflow-editor")
+}
+
func runPlugin(plugin Plugin, args []string, pluginInput PluginInput) error {
if !configs.IsCIMode && configs.CheckIsPluginUpdateCheckRequired() {
// Check for new version
@@ -82,8 +91,7 @@ func runPlugin(plugin Plugin, args []string, pluginInput PluginInput) error {
log.Warnf("")
log.Warnf("Failed to check for plugin (%s) new version, error: %s", plugin.Name, err)
} else if newVersion != "" {
- log.Warnf("")
- log.Warnf("New version (%s) of plugin (%s) available", newVersion, plugin.Name)
+ printPluginUpdateInfos(newVersion, plugin)
route, found, err := ReadPluginRoute(plugin.Name)
if err != nil {
@@ -117,8 +125,8 @@ func runPlugin(plugin Plugin, args []string, pluginInput PluginInput) error {
}
if route.LatestAvailableVersion != "" {
- log.Warnf("")
- log.Warnf("New version (%s) of plugin (%s) available", route.LatestAvailableVersion, plugin.Name)
+ printPluginUpdateInfos(route.LatestAvailableVersion, plugin)
+ fmt.Println()
}
}
