From fe16238983719357921adafe13e2618bbb674031 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sat, 25 Jul 2026 01:33:22 -0400 Subject: [PATCH] Refactor run_custom_user_commands (#4668) --- archinstall/lib/installer.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 5c0e0880..71d13241 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -2131,13 +2131,12 @@ def accessibility_tools_in_use() -> bool: def run_custom_user_commands(commands: list[str], installation: Installer) -> None: for index, command in enumerate(commands): - script_path = f'/var/tmp/user-command.{index}.sh' - chroot_path = f'{installation.target}/{script_path}' + script_path = LPath(f'/var/tmp/user-command.{index}.sh') + chroot_path = installation.target / script_path.relative_to_root() info(f'Executing custom command "{command}" ...') - with open(chroot_path, 'w') as user_script: - user_script.write(command) + chroot_path.write_text(command) SysCommand(f'arch-chroot -S {installation.target} bash {script_path}') - os.unlink(chroot_path) + chroot_path.unlink()