Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-12-06 16:30:29 +0100
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-12-06 16:30:29 +0100
commit101f3bdde9cbbaf1abb49d1852a5812b681f33bc (patch)
tree06e48756301cabea555bfac3c2a7ba675eb60998
parenteaf45282764bcd71fc714e820e133ff3921dfa58 (diff)
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.
-rw-r--r--archinstall/__main__.py6
-rw-r--r--archinstall/lib/storage.py2
2 files changed, 7 insertions, 1 deletions
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__':
diff --git a/archinstall/lib/storage.py b/archinstall/lib/storage.py
index 7c2c2661..3af15153 100644
--- a/archinstall/lib/storage.py
+++ b/archinstall/lib/storage.py
@@ -12,7 +12,7 @@ storage = {
'./profiles',
'~/.config/archinstall/profiles',
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'profiles'),
- os.path.abspath(f'{os.path.dirname(__file__)}/../examples')
+ #os.path.abspath(f'{os.path.dirname(__file__)}/../examples')
],
'UPSTREAM_URL' : 'https://raw.githubusercontent.com/Torxed/archinstall/master/profiles',
'PROFILE_DB' : None # Used in cases when listing profiles is desired, not mandatory for direct profile grabing.