mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-24 17:44:32 +02:00
Improve r13y of packwiz modrinth export by sorting manifestFiles (#287)
resolves #244
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user