index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-04-06 16:31:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 16:31:31 +0000 |
commit | ce2ebc0026573f7b4ce4231a8715de512df02c0a (patch) | |
tree | bb24a85db36b0d26aab019d79d0cbe9ad0f756de /archinstall/__main__.py | |
parent | 3da4dc8e3015479e64603987ae229f75e2146548 (diff) | |
parent | 27853bf444b2f5c3355be58409106bc5fa1c2c4b (diff) |
-rw-r--r-- | archinstall/__main__.py | 30 |
diff --git a/archinstall/__main__.py b/archinstall/__main__.py index 63c2f715..86ed0108 100644 --- a/archinstall/__main__.py +++ b/archinstall/__main__.py @@ -2,33 +2,5 @@ import archinstall import sys import os -# TODO: Learn the dark arts of argparse... -# (I summon thee dark spawn of cPython) - -def run_as_a_module(): - """ - Since we're running this as a 'python -m archinstall' module OR - a nuitka3 compiled version of the project. - This function and the file __main__ acts as a entry point. - """ - - # Add another path for finding profiles, so that list_profiles() in Script() can find guided.py, unattended.py etc. - archinstall.storage['PROFILE_PATH'].append(os.path.abspath(f'{os.path.dirname(__file__)}/examples')) - - if len(sys.argv) == 1: - sys.argv.append('guided') - - try: - script = archinstall.Script(sys.argv[1]) - except archinstall.ProfileNotFound as err: - print(f"Couldn't find file: {err}") - sys.exit(1) - - os.chdir(os.path.abspath(os.path.dirname(__file__))) - - # Remove the example directory from the PROFILE_PATH, to avoid guided.py etc shows up in user input questions. - archinstall.storage['PROFILE_PATH'].pop() - script.execute() - if __name__ == '__main__': - run_as_a_module() + archinstall.run_as_a_module() |