From 101f3bdde9cbbaf1abb49d1852a5812b681f33bc Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 6 Dec 2020 16:30:29 +0100 Subject: Removed /examples/ from list_profiles() by default Adding it back in in "module mode" so that it can find guided.py correctly. This voids showing it in the user-question section. --- archinstall/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'archinstall/__main__.py') diff --git a/archinstall/__main__.py b/archinstall/__main__.py index dcf61f58..dd702ecf 100644 --- a/archinstall/__main__.py +++ b/archinstall/__main__.py @@ -12,6 +12,9 @@ def run_as_a_module(): 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') @@ -22,6 +25,9 @@ def run_as_a_module(): 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__': -- cgit v1.2.3-54-g00ecf