Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-02-02 08:09:12 +0100
committerGitHub <noreply@github.com>2022-02-02 08:09:12 +0100
commit5cfec48ac4e05c258d628ae24e7510b6dc093e82 (patch)
tree8b4cae894085a35a07241039681d85becc2c0694
parente3adab13e837cbca619a7914b76c72e4d1e6d4d8 (diff)
Added a by-path import to support git clone - import of the library (#931)
-rw-r--r--archinstall/__main__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/archinstall/__main__.py b/archinstall/__main__.py
index c8a4779b..e125930f 100644
--- a/archinstall/__main__.py
+++ b/archinstall/__main__.py
@@ -1,4 +1,15 @@
-import archinstall
+import importlib
+import sys
+import pathlib
+
+# Load .git version before the builtin version
+if pathlib.Path('./archinstall/__init__.py').absolute().exists():
+ spec = importlib.util.spec_from_file_location("archinstall", "./archinstall/__init__.py")
+ archinstall = importlib.util.module_from_spec(spec)
+ sys.modules["archinstall"] = archinstall
+ spec.loader.exec_module(sys.modules["archinstall"])
+else:
+ import archinstall
if __name__ == '__main__':
archinstall.run_as_a_module()