mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Improve r13y of packwiz modrinth export
by sorting manifestFiles
(#287)
resolves #244
This commit is contained in:
parent
5bb680f266
commit
9cca74476d
@ -9,6 +9,7 @@ import (
|
|||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/packwiz/packwiz/core"
|
"github.com/packwiz/packwiz/core"
|
||||||
@ -172,6 +173,10 @@ var exportCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// sort by `path` property before serialising to ensure reproducibility
|
||||||
|
sort.Slice(manifestFiles, func(i, j int) bool {
|
||||||
|
return manifestFiles[i].Path < manifestFiles[j].Path
|
||||||
|
})
|
||||||
|
|
||||||
err = session.SaveIndex()
|
err = session.SaveIndex()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user