File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,16 +143,13 @@ def ensure_console_log_exists(config: BuildConfig, archive_dir: Path) -> None:
143143
144144
145145def create_7z_archive (archive_path : Path , source_dir : Path ) -> None :
146- """Create a 7z archive from a source directory."""
146+ """Create a 7z archive from a source directory, preserving the directory name in the archive ."""
147147 print (f"Creating { archive_path .name } ..." )
148148 try :
149149 with py7zr .SevenZipFile (str (archive_path ), 'w' ) as archive :
150- # Add all contents of source_dir directly to archive (not wrapped in source_dir name)
151- for item in source_dir .iterdir ():
152- if item .is_dir ():
153- archive .writeall (str (item ), arcname = item .name )
154- else :
155- archive .write (str (item ), arcname = item .name )
150+ # Archive the directory itself (not just its contents)
151+ # This preserves the directory name in the archive, matching shell script behavior
152+ archive .writeall (str (source_dir ), arcname = source_dir .name )
156153 print (f" Successfully created { archive_path .name } " )
157154 except Exception as e :
158155 print (f" Warning: Failed to create { archive_path .name } : { e } " )
You can’t perform that action at this time.
0 commit comments