diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-11-12 08:11:47 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-11-12 08:11:47 +0000 |
commit | 98947d173e3f1667eba29c904f681047dea9de90 (patch) | |
tree | 19148691781555c05ad9b02b0130860632da172b /launch.py | |
parent | a1a376331c9ecbbee77b86daeaba44587cc56557 (diff) | |
download | stable-diffusion-webui-gfx803-98947d173e3f1667eba29c904f681047dea9de90.tar.gz stable-diffusion-webui-gfx803-98947d173e3f1667eba29c904f681047dea9de90.tar.bz2 stable-diffusion-webui-gfx803-98947d173e3f1667eba29c904f681047dea9de90.zip |
run installers for newly installed extensions
Diffstat (limited to 'launch.py')
-rw-r--r-- | launch.py | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -105,22 +105,26 @@ def version_check(commit): print("version check failed", e)
+def run_extension_installer(extension_dir):
+ path_installer = os.path.join(extension_dir, "install.py")
+ if not os.path.isfile(path_installer):
+ return
+
+ try:
+ env = os.environ.copy()
+ env['PYTHONPATH'] = os.path.abspath(".")
+
+ print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env))
+ except Exception as e:
+ print(e, file=sys.stderr)
+
+
def run_extensions_installers():
if not os.path.isdir(dir_extensions):
return
for dirname_extension in os.listdir(dir_extensions):
- path_installer = os.path.join(dir_extensions, dirname_extension, "install.py")
- if not os.path.isfile(path_installer):
- continue
-
- try:
- env = os.environ.copy()
- env['PYTHONPATH'] = os.path.abspath(".")
-
- print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}", custom_env=env))
- except Exception as e:
- print(e, file=sys.stderr)
+ run_extension_installer(os.path.join(dir_extensions, dirname_extension))
def prepare_enviroment():
|