citadel-apps/lib/manage.py

23 lines
747 B
Python
Raw Permalink Normal View History

2021-10-12 20:46:35 +00:00
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2021 Aaron Dewes <aaron.dewes@protonmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-only
import os
import json
from lib.validate import findAndValidateApps
from lib.metadata import getSimpleAppRegistry
2021-10-13 13:36:12 +00:00
appsDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "apps")
2021-10-12 20:46:35 +00:00
def update():
apps = findAndValidateApps(appsDir)
simpleRegistry = getSimpleAppRegistry(apps, appsDir)
2021-10-13 13:36:12 +00:00
with open(os.path.join(appsDir, "..", "apps.json"), "w") as f:
2021-10-12 20:46:35 +00:00
json.dump(simpleRegistry, f, indent=4, sort_keys=True)
2021-10-13 13:36:12 +00:00
with open(os.path.join(appsDir, "apps.json"), "w") as f:
json.dump(simpleRegistry, f, indent=4, sort_keys=True)
2021-10-12 20:46:35 +00:00
print("Wrote information to apps.json")