diff --git a/installer/build.py b/installer/build.py index 9255ac2..55d3066 100755 --- a/installer/build.py +++ b/installer/build.py @@ -7,13 +7,23 @@ def create_tar_gz(archive_name, files): with tarfile.open(archive_name, "w:gz") as tar: for file in files: if os.path.isfile(file): - tar.add(file) - print(f"Added '{file}' to '{archive_name}'.") + # Add file with its original name (no path) + arcname = os.path.basename(file) + tar.add(file, arcname=arcname) + print(f"Added '{file}' as '{arcname}' to '{archive_name}'.") else: print(f"Error: '{file}' does not exist and was not added.") print(f"\nArchive '{archive_name}' created successfully.") + + # Verify the archive contents + print("\nVerifying archive contents:") + with tarfile.open(archive_name, "r:gz") as tar: + for member in tar.getnames(): + print(f" - {member}") + except Exception as e: print(f"An error occurred while creating the archive: {e}") + sys.exit(1) def main():