Skip to content

Commit

Permalink
Updated packaging and indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Jul 10, 2024
1 parent 09a75d3 commit 4b99fe7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
output
__pycache__
*.7z
temp
2 changes: 1 addition & 1 deletion scripts/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/package_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4b99fe7

Please sign in to comment.