mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 19:29:15 +02:00
Merge branch 'master' into develop
This commit is contained in:
commit
1ef47a1216
3 changed files with 67 additions and 27 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
|
@ -34,11 +35,26 @@ def get_versions():
|
|||
return sorted(valid, key=lambda tag: StrictVersion(tag["id"]), reverse=True)
|
||||
|
||||
|
||||
def main():
|
||||
def main(latest=False):
|
||||
versions = get_versions()
|
||||
data = {"count": len(versions), "releases": versions}
|
||||
print(json.dumps(data))
|
||||
if latest:
|
||||
print(versions[0]["id"])
|
||||
else:
|
||||
data = {"count": len(versions), "releases": versions}
|
||||
print(json.dumps(data, sort_keys=True, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
parser = argparse.ArgumentParser(
|
||||
"""
|
||||
Compile release data and output in in JSON format
|
||||
"""
|
||||
)
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--latest",
|
||||
action="store_true",
|
||||
help="Only print the latest version then exit",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
main(latest=args.latest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue