1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-15 05:20:09 +02:00

Also write status.json when command finished

This commit is contained in:
Jochen Sprickerhof 2022-08-20 19:52:57 +02:00 committed by Hans-Christoph Steiner
parent 10528b832a
commit 153f136e79

View File

@ -900,9 +900,13 @@ def write_status_json(output, pretty=False, name=None):
os.makedirs(status_dir) os.makedirs(status_dir)
if not name: if not name:
output['endTimestamp'] = int(datetime.now(timezone.utc).timestamp() * 1000) output['endTimestamp'] = int(datetime.now(timezone.utc).timestamp() * 1000)
name = sys.argv[0].split()[1] # fdroid subcommand names = ['running', sys.argv[0].split()[1]] # fdroid subcommand
path = os.path.join(status_dir, name + '.json') else:
with open(path, 'w') as fp: names = [name]
for fname in names:
path = os.path.join(status_dir, fname + '.json')
with open(path, "w", encoding="utf-8") as fp:
if pretty: if pretty:
json.dump(output, fp, sort_keys=True, cls=Encoder, indent=2) json.dump(output, fp, sort_keys=True, cls=Encoder, indent=2)
else: else: