11import os
22import time
3- from pathlib import Path
43
54from archinstall .lib .applications .application_handler import ApplicationHandler
6- from archinstall .lib .args import arch_config_handler
5+ from archinstall .lib .args import ArchConfigHandler
76from archinstall .lib .authentication .authentication_handler import AuthenticationHandler
87from archinstall .lib .configuration import ConfigurationOutput
98from archinstall .lib .disk .filesystem import FilesystemHandler
2221from archinstall .lib .translationhandler import tr
2322
2423
25- def show_menu (mirror_list_handler : MirrorListHandler ) -> None :
24+ def show_menu (
25+ arch_config_handler : ArchConfigHandler ,
26+ mirror_list_handler : MirrorListHandler ,
27+ ) -> None :
2628 upgrade = check_version_upgrade ()
2729 title_text = 'Archlinux'
2830
@@ -44,7 +46,7 @@ def show_menu(mirror_list_handler: MirrorListHandler) -> None:
4446
4547
4648def perform_installation (
47- mountpoint : Path ,
49+ arch_config_handler : ArchConfigHandler ,
4850 mirror_list_handler : MirrorListHandler ,
4951 auth_handler : AuthenticationHandler ,
5052 application_handler : ApplicationHandler ,
@@ -57,6 +59,7 @@ def perform_installation(
5759 start_time = time .monotonic ()
5860 info ('Starting installation...' )
5961
62+ mountpoint = arch_config_handler .args .mountpoint
6063 config = arch_config_handler .config
6164
6265 if not config .disk_config :
@@ -188,14 +191,17 @@ def perform_installation(
188191 pass
189192
190193
191- def main () -> None :
194+ def main (arch_config_handler : ArchConfigHandler | None = None ) -> None :
195+ if arch_config_handler is None :
196+ arch_config_handler = ArchConfigHandler ()
197+
192198 mirror_list_handler = MirrorListHandler (
193199 offline = arch_config_handler .args .offline ,
194200 verbose = arch_config_handler .args .verbose ,
195201 )
196202
197203 if not arch_config_handler .args .silent :
198- show_menu (mirror_list_handler )
204+ show_menu (arch_config_handler , mirror_list_handler )
199205
200206 config = ConfigurationOutput (arch_config_handler .config )
201207 config .write_debug ()
@@ -211,14 +217,14 @@ def main() -> None:
211217 aborted = True
212218
213219 if aborted :
214- return main ()
220+ return main (arch_config_handler )
215221
216222 if arch_config_handler .config .disk_config :
217223 fs_handler = FilesystemHandler (arch_config_handler .config .disk_config )
218224 fs_handler .perform_filesystem_operations ()
219225
220226 perform_installation (
221- arch_config_handler . args . mountpoint ,
227+ arch_config_handler ,
222228 mirror_list_handler ,
223229 AuthenticationHandler (),
224230 ApplicationHandler (),
0 commit comments