Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan M. Taylor <dylan@dylanmtaylor.com>2021-05-19 19:10:12 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-19 22:09:27 -0400
commit592c1737671e4de8f9601f94020d7fb9c162e6cb (patch)
treef74f9c43d0241bd8417f1726859d9f0c73062dfd
parent7775d877d857dc732564e23d5c5d16720404ee26 (diff)
Iterate over custom-command array
-rw-r--r--examples/guided.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/guided.py b/examples/guided.py
index f0d0db7a..7ded5c53 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -4,6 +4,7 @@ import os
import time
import archinstall
+from archinstall.lib.general import SysCommand
from archinstall.lib.hardware import has_uefi
from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profiles import Profile
@@ -380,6 +381,13 @@ def perform_installation(mountpoint):
if not imported._post_install():
archinstall.log(' * Profile\'s post configuration requirements was not fulfilled.', fg='red')
exit(1)
+
+ # If the user provided custom commands to be run post-installation, execute them now.
+ if len(archinstall.arguments['custom-commands']):
+ for command in archinstall.arguments['custom-commands']:
+ archinstall.log(f'Executing custom command "{command}" ...', fg='yellow')
+ SysCommand(f"arch-chroot /mnt {command}")
+
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'):