Skip to content

Commit

Permalink
sort sourceList by id (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
suiyuran authored Jul 16, 2023
1 parent 68f92a8 commit cf228de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"sort"
"strings"
"sync"

Expand Down Expand Up @@ -144,6 +145,10 @@ func BuildSource(zipFiles []string, output string) error {
}
wg.Wait()

sort.Slice(sourceList.data, func(i, j int) bool {
return sourceList.data[i].Id < sourceList.data[j].Id
})

b, err := json.Marshal(sourceList.data)
if err != nil {
color.Red("fatal: couldn't serialize source list: %s", err.Error())
Expand Down

0 comments on commit cf228de

Please sign in to comment.