File tree Expand file tree Collapse file tree 5 files changed +20
-15
lines changed
Expand file tree Collapse file tree 5 files changed +20
-15
lines changed 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,19 @@ 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 :
41- success = not wifi_handler .setup ()
42- if not success :
43- sys .exit (0 )
41+ if wifi_handler .setup ():
42+ return False
4443
44+ return True
4545
46- def _fetch_arch_db () -> None :
46+
47+ def _fetch_arch_db () -> bool :
4748 info ('Fetching Arch Linux package database...' )
4849 try :
4950 Pacman .run ('-Sy' )
@@ -55,7 +56,9 @@ def _fetch_arch_db() -> None:
5556 error ('Run archinstall --debug and check /var/log/archinstall/install.log for details.' )
5657
5758 debug (f'Failed to sync Arch Linux package database: { e } ' )
58- sys .exit (1 )
59+ return False
60+
61+ return True
5962
6063
6164def run () -> int :
@@ -75,8 +78,11 @@ def run() -> int:
7578 _log_sys_info ()
7679
7780 if not arch_config_handler .args .offline :
78- _check_online ()
79- _fetch_arch_db ()
81+ if not _check_online ():
82+ return 0
83+
84+ if not _fetch_arch_db ():
85+ return 1
8086
8187 if not arch_config_handler .args .skip_version_check :
8288 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