Skip to content

Commit 6505e17

Browse files
authored
Refactor sync_log_to_install_medium() (#4397)
1 parent 78987d7 commit 6505e17

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

archinstall/lib/installer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,9 @@ def sync_log_to_install_medium(self) -> bool:
506506
# at least the base has been strapped in, otherwise we won't have a filesystem/structure to copy to.
507507
if self._helper_flags.get('base-strapped', False) is True:
508508
absolute_logfile = logger.path
509-
510-
if not os.path.isdir(f'{self.target}/{os.path.dirname(absolute_logfile)}'):
511-
os.makedirs(f'{self.target}/{os.path.dirname(absolute_logfile)}')
512-
513-
shutil.copy2(absolute_logfile, f'{self.target}/{absolute_logfile}')
509+
logfile_target = self.target / absolute_logfile
510+
logfile_target.parent.mkdir(parents=True, exist_ok=True)
511+
absolute_logfile.copy(logfile_target, preserve_metadata=True)
514512

515513
return True
516514

0 commit comments

Comments
 (0)