Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-05-20 16:51:05 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-20 17:12:41 -0400
commit5652ba20aebf11fa482c74cd85468bd092bc8213 (patch)
tree0881832ff4354d918b43c3de81275183c0f41651 /examples
parent11c963232203d463c4fc6f9ec23f60d3b034572b (diff)
Extract custom-commands function into general.py
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 7c93ac16..fc24ad7e 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -4,10 +4,9 @@ import os
import time
import archinstall
-from archinstall.lib.general import SysCommand
+from archinstall.lib.general import run_custom_user_commands
from archinstall.lib.hardware import has_uefi
from archinstall.lib.networking import check_mirror_reachable
-from archinstall.lib.profiles import Profile
if archinstall.arguments.get('help'):
print("See `man archinstall` for help.")
@@ -378,14 +377,8 @@ def perform_installation(mountpoint):
exit(1)
# If the user provided custom commands to be run post-installation, execute them now.
- if len(archinstall.arguments['custom-commands']):
- for index, command in enumerate(archinstall.arguments['custom-commands']):
- archinstall.log(f'Executing custom command "{command}" ...', fg='yellow')
- with open(f"/mnt/var/tmp/user-command.{index}.sh", "w") as temp_script:
- temp_script.write(command)
- execution_output = SysCommand(f"arch-chroot /mnt bash /var/tmp/user-command.{index}.sh")
- archinstall.log(execution_output)
- os.unlink(f"/mnt/var/tmp/user-command.{index}.sh")
+ if archinstall.arguments.get('custom-commands', None):
+ run_custom_user_commands(archinstall.arguments['custom-commands'])
installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
if not archinstall.arguments.get('silent'):