File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
2+
13from archinstall .main import main
24
35if __name__ == '__main__' :
4- main ()
6+ sys . exit ( main () )
Original file line number Diff line number Diff line change @@ -32,18 +32,20 @@ def _log_sys_info() -> None:
3232 debug (f'Disk states before installing:\n { disk_layouts ()} ' )
3333
3434
35- def _check_online () -> None :
35+ def _check_online () -> bool :
3636 try :
3737 ping ('1.1.1.1' )
3838 except OSError as ex :
3939 if 'Network is unreachable' in str (ex ):
4040 if not arch_config_handler .args .skip_wifi_check :
4141 success = not wifi_handler .setup ()
4242 if not success :
43- sys . exit ( 0 )
43+ return False
4444
45+ return True
4546
46- def _fetch_arch_db () -> None :
47+
48+ def _fetch_arch_db () -> bool :
4749 info ('Fetching Arch Linux package database...' )
4850 try :
4951 Pacman .run ('-Sy' )
@@ -55,7 +57,9 @@ def _fetch_arch_db() -> None:
5557 error ('Run archinstall --debug and check /var/log/archinstall/install.log for details.' )
5658
5759 debug (f'Failed to sync Arch Linux package database: { e } ' )
58- sys .exit (1 )
60+ return False
61+
62+ return True
5963
6064
6165def run () -> int :
@@ -75,8 +79,11 @@ def run() -> int:
7579 _log_sys_info ()
7680
7781 if not arch_config_handler .args .offline :
78- _check_online ()
79- _fetch_arch_db ()
82+ if not _check_online ():
83+ return 0
84+
85+ if not _fetch_arch_db ():
86+ return 1
8087
8188 if not arch_config_handler .args .skip_version_check :
8289 upgrade = check_version_upgrade ()
Original file line number Diff line number Diff line change 11import os
2- import sys
32import time
43from pathlib import Path
54
@@ -192,7 +191,7 @@ def guided() -> None:
192191 config .save ()
193192
194193 if arch_config_handler .args .dry_run :
195- sys . exit ( 0 )
194+ return
196195
197196 if not arch_config_handler .args .silent :
198197 aborted = False
Original file line number Diff line number Diff line change 1- import sys
21from pathlib import Path
32
43from archinstall .default_profiles .minimal import MinimalProfile
@@ -68,7 +67,7 @@ def _minimal() -> None:
6867 config .save ()
6968
7069 if arch_config_handler .args .dry_run :
71- sys . exit ( 0 )
70+ return
7271
7372 if not arch_config_handler .args .silent :
7473 aborted = False
Original file line number Diff line number Diff line change 1- import sys
21from pathlib import Path
32
43from archinstall .lib .args import arch_config_handler
@@ -64,7 +63,7 @@ def _only_hd() -> None:
6463 config .save ()
6564
6665 if arch_config_handler .args .dry_run :
67- sys . exit ( 0 )
66+ return
6867
6968 if not arch_config_handler .args .silent :
7069 aborted = False
You can’t perform that action at this time.
0 commit comments