Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/__main__.py')
-rw-r--r--archinstall/__main__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/archinstall/__main__.py b/archinstall/__main__.py
index fe4a3732..48d8a5ce 100644
--- a/archinstall/__main__.py
+++ b/archinstall/__main__.py
@@ -33,6 +33,10 @@ def run_as_a_module():
if f'{profile}.py' not in library:
raise ProfileNotFound(f'Could not locate {profile}.py among the example files.')
+ # Swap the working dir, otherwise certain relative lookups won't work within archinstall.
+ # Mainly to avoid https://github.com/Torxed/archinstall/issues/59
+ os.chdir(os.path.abspath(os.path.dirname(__file__)))
+
# Import and execute the chosen `<profile>.py`:
spec = importlib.util.spec_from_file_location(
library[f"{profile}.py"],