Iterate over custom-command array

This commit is contained in:
Dylan M. Taylor 2021-05-19 19:10:12 -04:00 committed by Dylan Taylor
parent 7775d877d8
commit 592c173767
1 changed files with 8 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import os
import time import time
import archinstall import archinstall
from archinstall.lib.general import SysCommand
from archinstall.lib.hardware import has_uefi from archinstall.lib.hardware import has_uefi
from archinstall.lib.networking import check_mirror_reachable from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profiles import Profile from archinstall.lib.profiles import Profile
@ -381,6 +382,13 @@ def perform_installation(mountpoint):
archinstall.log(' * Profile\'s post configuration requirements was not fulfilled.', fg='red') archinstall.log(' * Profile\'s post configuration requirements was not fulfilled.', fg='red')
exit(1) 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") 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'): if not archinstall.arguments.get('silent'):
choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ") choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ")