Skip to content

Commit

Permalink
sortrepo: Display GLB files first in inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
lordfolken committed Oct 23, 2023
1 parent 4c5d381 commit d0dd22e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion script/build/sortrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ def parse_file(filename):
return records


def custom_sort_key(record):
name = record["name"]
if name.startswith("GLB-"):
return (0, name) # Sort "GLB-" names first
else:
return (1, name) # Sort all other names


def sort_records(records):
return sorted(records, key=lambda x: x["name"])
return sorted(records, key=custom_sort_key)


def format_records(records):
Expand Down

0 comments on commit d0dd22e

Please sign in to comment.