From 4b99fe70ea04dfdfe09a86f2095a1b423485b527 Mon Sep 17 00:00:00 2001 From: strahi-linux Date: Wed, 10 Jul 2024 09:36:41 +0200 Subject: [PATCH] Updated packaging and indexing --- .gitignore | 1 + scripts/index.py | 2 +- scripts/package_assets.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c3b538b..6f09ddd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ output __pycache__ *.7z +temp diff --git a/scripts/index.py b/scripts/index.py index d10d49c..b30ed8e 100644 --- a/scripts/index.py +++ b/scripts/index.py @@ -68,7 +68,7 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai 'updated_at' : asset['updated_at'], 'category': 'Software Development Kit', 'download_link': asset['url'], # Adjust as needed for actual URL - 'install_location' : f"%APPLICATION_DATA_DIR%/packages/legacy/{name_without_extension}", + 'install_location' : f"%APPLICATION_DATA_DIR%/packages/legacy/{name_without_extension.lower()}", 'package_changed': True } diff --git a/scripts/package_assets.py b/scripts/package_assets.py index 81d27ed..42ce0ba 100644 --- a/scripts/package_assets.py +++ b/scripts/package_assets.py @@ -11,14 +11,14 @@ def zip_directory(data): dirToZip, version = data source_dir = f"packages/{dirToZip}" - result_dir = f"temp/{source_dir}/legacy-{dirToZip}" + result_dir = f"temp/{source_dir}/legacy-{dirToZip.lower()}" print(f"Starting to copy files from {source_dir} to {result_dir}...") shutil.copytree(source_dir, result_dir, dirs_exist_ok=True) print(f"Files copied successfully to {result_dir}.") archive_name = f"{os.path.dirname(result_dir)}/{dirToZip}.7z" print(f"Starting to create archive {archive_name}...") with py7zr.SevenZipFile(archive_name, mode='w') as z: - z.writeall(result_dir, f"legacy-{dirToZip}") + z.writeall(result_dir, f"legacy-{dirToZip.lower()}") print(f"Archive {archive_name} created successfully.") return archive_name