Skip to content

Commit

Permalink
[java] Sort versions by date then version
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwrobel committed Jan 8, 2023
1 parent a0d1701 commit 99bee3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def main():
print("::endgroup::")

with open(f"releases/{PRODUCT}.json", "w") as f:
f.write(json.dumps(
# sort by date desc
dict(sorted(releases.items(), key=lambda e: e[1], reverse=True)),
indent=2))
f.write(json.dumps(dict(
# sort by date then version (desc)
sorted(releases.items(), key=lambda x: (x[1], x[0]), reverse=True)
), indent=2))


if __name__ == '__main__':
Expand Down

0 comments on commit 99bee3d

Please sign in to comment.