From 11285144600f9681457f474abd1e9bd029a4907a Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 24 Nov 2023 18:06:42 +0100 Subject: [PATCH] Build a channel file --- tasks/crawl.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tasks/crawl.py b/tasks/crawl.py index 026afc8..cf1ed37 100644 --- a/tasks/crawl.py +++ b/tasks/crawl.py @@ -147,7 +147,10 @@ def run( print(f"Fetching packages from {repo_url}...") try: - packages = [package for _, package in repo.get_packages(blacklist)] + packages = [] + for _, info in repo.get_packages(blacklist): + del info["sources"] + packages.append(info) except Exception as e: print(f" Failed to fetch packages: {e}") else: @@ -157,7 +160,10 @@ def run( num_packages += len(packages) try: - libraries = [library for _, library in repo.get_libraries(blacklist)] + libraries = [] + for _, info in repo.get_libraries(blacklist): + del info["sources"] + libraries.append(info) except Exception as e: print(f" Failed to fetch libraries: {e}") else: @@ -213,8 +219,9 @@ def run( json_content = json.dumps( { - "$schema": "sublime://packagecontrol.io/schemas/repository", + "$schema": "sublime://packagecontrol.io/schemas/channel", "schema_version": "4.0.0", + "repositories": repo_urls, "packages": packages_cache, "libraries": libraries_cache }, @@ -228,7 +235,7 @@ def run( dist_dir = root / '_site' dist_dir.mkdir(exist_ok=True) - result = store_asset(dist_dir / 'libraries.json', json_content) + result = store_asset(dist_dir / 'channel_v4.json', json_content) if result: print("Stored resolved repository!") else: