Skip to content

Commit

Permalink
Improve ordering in emsdk list (#1180)
Browse files Browse the repository at this point in the history
We have an existing `version_key` helper function for sorting versions.

It also does a better job, producing output like:

```
All recent (non-legacy) installable versions are:
         3.1.31
         3.1.31-asserts
         3.1.30
         3.1.30-asserts
         3.1.29
         3.1.29-asserts
```

Rather than:

```
All recent (non-legacy) installable versions are:
         3.1.31
         3.1.30
         3.1.29
         3.1.28
         3.1.27
```

(with -assert versions listed after 3.1.0)
  • Loading branch information
sbc100 authored Jan 30, 2023
1 parent c678733 commit 6305e91
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2845,11 +2845,7 @@ def installed_sdk_text(name):
print('')

print('All recent (non-legacy) installable versions are:')
releases_versions = sorted(
load_releases_versions(),
key=lambda x: [int(v) if v.isdigit() else -1 for v in x.split('.')],
reverse=True,
)
releases_versions = sorted(load_releases_versions(), key=version_key, reverse=True)
releases_info = load_releases_info()['releases']
for ver in releases_versions:
print(' %s %s' % (ver, installed_sdk_text('sdk-releases-%s-64bit' % get_release_hash(ver, releases_info))))
Expand Down

0 comments on commit 6305e91

Please sign in to comment.