Skip to content

Commit

Permalink
Merge pull request #135 from akamai/release/v1.3.1
Browse files Browse the repository at this point in the history
Release/v1.3.1
  • Loading branch information
Slonimskaia committed Dec 8, 2021
2 parents 4174985 + 621ffa3 commit e86a288
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.3.1 (December 8, 2021)

## Enhancements
* Improved message for updating CLI version

# 1.3.0 (October 6, 2021)

## Fixes
Expand Down
9 changes: 6 additions & 3 deletions pkg/commands/command_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion pkg/commands/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/Masterminds/semver"

const (
// Version Application Version
Version = "1.3.0"
Version = "1.3.1"
)

// Compare ...
Expand Down

0 comments on commit e86a288

Please sign in to comment.