Fix config data and make error handling/logging more robust

master
Beq 2024-09-16 18:42:56 +01:00
parent 5d99ac6d00
commit 72ca952e6c
2 changed files with 11 additions and 10 deletions

View File

@ -16,7 +16,7 @@
}, },
"os_hosted_folder": { "os_hosted_folder": {
"windows": "windows", "windows": "windows",
"darwin": "mac", "macos": "mac",
"linux": "linux" "linux": "linux"
}, },
"platforms_printable": { "platforms_printable": {

View File

@ -188,18 +188,19 @@ def unpack_artifacts(path_to_artifacts_directory, config):
build_folder = get_hosted_folder_for_build_type(build_type, config) build_folder = get_hosted_folder_for_build_type(build_type, config)
print(f"build_folder {build_folder}") print(f"build_folder {build_folder}")
build_type_dir = os.path.join(path_to_artifacts_directory, build_folder)
try: try:
os_folder = get_hosted_folder_for_os_type(platform, config) build_type_dir = os.path.join(path_to_artifacts_directory, build_folder)
except KeyError:
print(f"Invalid OS platform {platform} specified by file {file} - skipping")
continue
except Exception as e: except Exception as e:
print(f"An error occurred while getting OS folder: {e}") print(f"An error occurred while creating build_type_dir folder from {path_to_artifacts_directory} and {build_folder}: {e}")
continue
print(f"build_type_dir {build_type_dir}")
os_folder = get_hosted_folder_for_os_type(platform, config)
print(f"os_folder {os_folder}")
try:
unpack_folder = os.path.join(build_type_dir, os_folder)
except Exception as e:
print(f"An error occurred while creating unpack_folder folder from {build_type_dir} and {os_folder}: {e}")
continue continue
unpack_folder = os.path.join(build_type_dir, os_folder)
print(f"unpacking {filename} to {unpack_folder}") print(f"unpacking {filename} to {unpack_folder}")
try: try:
unzip_file(file, unpack_folder) unzip_file(file, unpack_folder)