diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5db9d..65b9732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.3.1 (December 8, 2021) + +## Enhancements +* Improved message for updating CLI version + # 1.3.0 (October 6, 2021) ## Fixes diff --git a/pkg/commands/command_upgrade_test.go b/pkg/commands/command_upgrade_test.go index 934f21e..f6b96b3 100644 --- a/pkg/commands/command_upgrade_test.go +++ b/pkg/commands/command_upgrade_test.go @@ -43,7 +43,8 @@ func TestCmdUpgrade(t *testing.T) { m.term.On("Spinner").Return(m.term).Once() m.term.On("Stop", terminal.SpinnerStatusOK).Return().Once() - m.term.On("Confirm", fmt.Sprintf("New upgrade found: 10.0.0 (you are running: %s). Upgrade now? [Y/n]: ", version.Version), true).Return(true, nil).Once() + m.term.On("Writeln", []interface{}{"You can find more details about the new version here: https://github.com/akamai/cli/releases"}).Return(0, nil).Once() + m.term.On("Confirm", fmt.Sprintf("New update found: 10.0.0. You are running: %s. Upgrade now?", version.Version), true).Return(true, nil).Once() // start upgrade m.term.On("Spinner").Return(m.term).Once() @@ -72,7 +73,8 @@ func TestCmdUpgrade(t *testing.T) { m.term.On("Spinner").Return(m.term).Once() m.term.On("Stop", terminal.SpinnerStatusOK).Return().Once() - m.term.On("Confirm", fmt.Sprintf("New upgrade found: 10.0.0 (you are running: %s). Upgrade now? [Y/n]: ", version.Version), true).Return(true, nil).Once() + m.term.On("Writeln", []interface{}{"You can find more details about the new version here: https://github.com/akamai/cli/releases"}).Return(0, nil).Once() + m.term.On("Confirm", fmt.Sprintf("New update found: 10.0.0. You are running: %s. Upgrade now?", version.Version), true).Return(true, nil).Once() // start upgrade m.term.On("Spinner").Return(m.term).Once() @@ -101,7 +103,8 @@ func TestCmdUpgrade(t *testing.T) { m.term.On("Spinner").Return(m.term).Once() m.term.On("Stop", terminal.SpinnerStatusOK).Return().Once() - m.term.On("Confirm", fmt.Sprintf("New upgrade found: 10.0.0 (you are running: %s). Upgrade now? [Y/n]: ", version.Version), true).Return(true, nil).Once() + m.term.On("Writeln", []interface{}{"You can find more details about the new version here: https://github.com/akamai/cli/releases"}).Return(0, nil).Once() + m.term.On("Confirm", fmt.Sprintf("New update found: 10.0.0. You are running: %s. Upgrade now?", version.Version), true).Return(true, nil).Once() // start upgrade m.term.On("Spinner").Return(m.term).Once() diff --git a/pkg/commands/upgrade.go b/pkg/commands/upgrade.go index 0a42270..ba62f19 100644 --- a/pkg/commands/upgrade.go +++ b/pkg/commands/upgrade.go @@ -86,8 +86,9 @@ func CheckUpgradeVersion(ctx context.Context, force bool) string { comp := version.Compare(version.Version, latestVersion) if comp == 1 { term.Spinner().Stop(terminal.SpinnerStatusOK) + _, _ = term.Writeln("You can find more details about the new version here: https://github.com/akamai/cli/releases") if answer, err := term.Confirm(fmt.Sprintf( - "New upgrade found: %s (you are running: %s). Upgrade now? [Y/n]: ", + "New update found: %s. You are running: %s. Upgrade now?", color.BlueString(latestVersion), color.BlueString(version.Version), ), true); err != nil || !answer { diff --git a/pkg/version/version.go b/pkg/version/version.go index 23ea277..dbd0bf4 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -4,7 +4,7 @@ import "github.com/Masterminds/semver" const ( // Version Application Version - Version = "1.3.0" + Version = "1.3.1" ) // Compare ...