diff --git a/cmd/hvm/use.go b/cmd/hvm/use.go index 34becfe..577e487 100644 --- a/cmd/hvm/use.go +++ b/cmd/hvm/use.go @@ -201,10 +201,6 @@ func (r *repository) fetchTags() error { } } - if Config.SortAscending { - semver.Sort(tagNames) - } - n := Config.NumTagsToDisplay if n < 0 { n = 9999 @@ -212,6 +208,11 @@ func (r *repository) fetchTags() error { if n <= len(tagNames) { tagNames = tagNames[len(tagNames)-n:] } + + if Config.SortAscending { + semver.Sort(tagNames) + } + r.tags = tagNames return nil