Skip to content

Commit

Permalink
Merge pull request #83 from rusenask/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rusenask authored Aug 6, 2017
2 parents 01d005e + e87a6e1 commit d940252
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion util/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewAvailable(current string, tags []string) (newVersion string, newAvailabl
sort.Sort(sort.Reverse(semver.Collection(vs)))

if currentVersion.LessThan(vs[0]) {
return vs[0].String(), true, nil
return vs[0].Original(), true, nil
}
return "", false, nil
}
Expand Down
16 changes: 15 additions & 1 deletion util/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,21 @@ func TestNewAvailable(t *testing.T) {
{
name: "staging",
args: args{current: "1.1.1", tags: []string{"v1.2.1-staging.1"}},
wantNewVersion: "1.2.1-staging.1",
wantNewVersion: "v1.2.1-staging.1",
wantNewAvailable: true,
wantErr: false,
},
{
name: "without patch version",
args: args{current: "8.1", tags: []string{"8.1", "8.2", "8.3"}},
wantNewVersion: "8.3",
wantNewAvailable: true,
wantErr: false,
},
{
name: "only major version",
args: args{current: "8.1.1", tags: []string{"8", "9", "10"}},
wantNewVersion: "10",
wantNewAvailable: true,
wantErr: false,
},
Expand Down

0 comments on commit d940252

Please sign in to comment.