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()