Skip to content

Commit

Permalink
list-local: changed order of versions output (new order: desc)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Jul 21, 2020
1 parent 86809ec commit 8f851b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"path"
"path/filepath"
"runtime"
"sort"
"strings"
"time"

Expand Down Expand Up @@ -249,6 +250,8 @@ func ListInstalledVersions(app string) ([]InstalledVersion, error) {
return nil, err
}

// Desc order by name
sort.Slice(files, func(i, j int) bool { return files[i].Name() > files[j].Name() })
res := []InstalledVersion{}
for _, f := range files {
if !f.IsDir() {
Expand Down

0 comments on commit 8f851b6

Please sign in to comment.