citadel-apps/lib/manage.py

23 lines
741 B
Python
Raw 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
appsDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")
def update():
apps = findAndValidateApps(appsDir)
simpleRegistry = getSimpleAppRegistry(apps, appsDir)
with open(os.path.join(appsDir, "apps.json"), "w") as f:
json.dump(simpleRegistry, f, indent=4, sort_keys=True)
with open(os.path.join(appsDir, "apps", "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")