mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +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)
|
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)
|
return json.Marshal(s)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue