Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Houser <stephenhouser@gmail.com>2023-09-14 07:41:48 -0400
committerGitHub <noreply@github.com>2023-09-14 21:41:48 +1000
commit31bd5e80e3a1fa6c99159415981b33d43461ee24 (patch)
tree1ba1040f75e9fce5a4c11d8224d1475f86b810ab
parent4e243fa8684cd54f0cbbd6679e259ffb9ee1a738 (diff)
fix custom-commands issue #2025 (#2026)
-rw-r--r--archinstall/lib/general.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 90af25ed..c1db6fb3 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -460,10 +460,12 @@ def _pid_exists(pid: int) -> 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 = installation.target / script_path
+ chroot_path = f"{installation.target}/{script_path}"
info(f'Executing custom command "{command}" ...')
- chroot_path.write_text(command)
+ with open(chroot_path, "w") as user_script:
+ user_script.write(command)
+
SysCommand(f"arch-chroot {installation.target} bash {script_path}")
os.unlink(chroot_path)