This can either be run as the compiled and installed application: python setup.py install OR straight as a module: python -m archinstall In any case we will be attempting to load the provided script to be run from the scripts/ folder
()
| 108 | |
| 109 | |
| 110 | def run() -> int: |
| 111 | """ |
| 112 | This can either be run as the compiled and installed application: python setup.py install |
| 113 | OR straight as a module: python -m archinstall |
| 114 | In any case we will be attempting to load the provided script to be run from the scripts/ folder |
| 115 | """ |
| 116 | arch_config_handler = ArchConfigHandler() |
| 117 | |
| 118 | if '--help' in sys.argv or '-h' in sys.argv: |
| 119 | arch_config_handler.print_help() |
| 120 | return 0 |
| 121 | |
| 122 | match arch_config_handler.args.command: |
| 123 | case SubCommand.SHARE_LOG: |
| 124 | _share_log_command() |
| 125 | exit(0) |
| 126 | case None: |
| 127 | pass |
| 128 | |
| 129 | script = arch_config_handler.get_script() |
| 130 | |
| 131 | if script == 'list': |
| 132 | print(_list_scripts()) |
| 133 | return 0 |
| 134 | |
| 135 | if os.getuid() != 0: |
| 136 | print(tr('Archinstall requires root privileges to run. See --help for more.')) |
| 137 | return 1 |
| 138 | |
| 139 | translation_handler.save_console_font() |
| 140 | |
| 141 | _log_sys_info() |
| 142 | |
| 143 | if not arch_config_handler.args.offline: |
| 144 | if not arch_config_handler.args.skip_wifi_check: |
| 145 | wifi_handler = WifiHandler() |
| 146 | else: |
| 147 | wifi_handler = None |
| 148 | |
| 149 | if not _check_online(wifi_handler): |
| 150 | return 0 |
| 151 | |
| 152 | if not _fetch_arch_db(): |
| 153 | return 1 |
| 154 | |
| 155 | if not arch_config_handler.args.skip_version_check: |
| 156 | upgrade = check_version_upgrade() |
| 157 | |
| 158 | if upgrade: |
| 159 | text = tr('New version available') + f': {upgrade}' |
| 160 | info(text) |
| 161 | time.sleep(3) |
| 162 | |
| 163 | if running_from_iso(): |
| 164 | debug('Running from ISO (Live Mode)...') |
| 165 | else: |
| 166 | debug('Running from Host (H2T Mode)...') |
| 167 |
no test coverage detected