Skip to content

Commit

Permalink
Fixed legacy package installation
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Jun 27, 2024
1 parent 378c2c7 commit 9a35dc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion scripts/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ 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
'package_changed': True
'package_changed': True,
'install_location' : "%APPLICATION_DATA_DIR%/sdk"
}

# Index the document
Expand Down
8 changes: 4 additions & 4 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}/v{version}"
result_dir = f"temp/{source_dir}/legacy-{dirToZip}"
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"v{version}")
z.writeall(result_dir, f"legacy-{dirToZip}")
print(f"Archive {archive_name} created successfully.")
return archive_name

Expand Down Expand Up @@ -46,7 +46,7 @@ async def upload_release_asset(session, token, repo, tag_name, asset_path):

async def main(token, repo, tag_name):
print("Number of CPU cores available:", os.cpu_count())

dirs_to_process = os.listdir("./packages")
print(f"Found directories: {dirs_to_process}")
zip_data = [prepare_zip_data(dir) for dir in dirs_to_process]
Expand All @@ -70,7 +70,7 @@ async def main(token, repo, tag_name):
parser.add_argument("repo", help="Repository name, e.g., 'username/repo'")
parser.add_argument("tag_name", help="Tag name from the release")
args = parser.parse_args()

print("Starting the upload process...")
asyncio.run(main(args.token, args.repo, args.tag_name))
print("Upload process completed.")

0 comments on commit 9a35dc0

Please sign in to comment.