Properly sort versions in "emsdk list" (#508)

Split version to integers but avoid exceptions in case there is a
non-numerical character in some version.

Comparison:
    Before   |   After
    1.39.9       1.39.16
    1.39.8       1.39.15
    1.39.7       1.39.14
    1.39.6       1.39.13
    1.39.5       1.39.12
    1.39.4       1.39.11
    1.39.3       1.39.10
    1.39.2       1.39.9
    1.39.16      1.39.8
    1.39.15      1.39.7
    1.39.14      1.39.6
    1.39.13      1.39.5
    1.39.12      1.39.4
    1.39.11      1.39.3
    1.39.10      1.39.2
    1.39.1       1.39.1
    1.39.0       1.39.0
    1.38.48      1.38.48
    1.38.47      1.38.47
    1.38.46      1.38.46
    1.38.45      1.38.45
    1.38.44      1.38.44
    1.38.43      1.38.43
    1.38.42      1.38.42
    1.38.41      1.38.41
    1.38.40      1.38.40
    1.38.39      1.38.39
    1.38.38      1.38.38
    1.38.37      1.38.37
    1.38.36      1.38.36
    1.38.35      1.38.35
    1.38.34      1.38.34
    1.38.33      1.38.33
This commit is contained in:
Orestis Floros 2020-06-02 00:15:41 +02:00 коммит произвёл GitHub
Родитель 858b176f68
Коммит 6b0d151917
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -2918,8 +2918,11 @@ def main():
print('')
print('All recent (non-legacy) installable versions are:')
releases_versions = sorted(load_releases_versions())
releases_versions.reverse()
releases_versions = sorted(
load_releases_versions(),
key=lambda x: [int(v) if v.isdigit() else -1 for v in x.split('.')],
reverse=True,
)
for ver in releases_versions:
print(' %s %s' % (ver, installed_sdk_text('sdk-releases-upstream-%s-64bit' % get_release_hash(ver, releases_info))))
print()