mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 16:10:04 +01:00
feat: sort output of jsonnetfile
To keep the output deterministic, both `jsonnetfile.json` and the lockfile are now sorted alphabetically by the packages name
This commit is contained in:
parent
ffd43cf94e
commit
cc1d7ea3b8
1 changed files with 3 additions and 0 deletions
|
|
@ -46,6 +46,9 @@ func (jf JsonnetFile) MarshalJSON() ([]byte, error) {
|
|||
s.Dependencies = append(s.Dependencies, d)
|
||||
}
|
||||
|
||||
sort.SliceStable(s.Dependencies, func(i int, j int) bool {
|
||||
return s.Dependencies[i].Name < s.Dependencies[j].Name
|
||||
})
|
||||
|
||||
return json.Marshal(s)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue