diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-03-11 09:20:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 09:20:30 +0000 |
commit | f0a917c990c93668b7c1ca814340f3405054a707 (patch) | |
tree | 25757340bf9f01355e57d92464ac1c5dc9a16633 /launch.py | |
parent | 58b5b7c2f1d3b843803c1fc7a0aae8b1d6be5763 (diff) | |
parent | 13081dd45ece33457f6cb2cad3a8e7840a0a6eaf (diff) | |
download | stable-diffusion-webui-gfx803-f0a917c990c93668b7c1ca814340f3405054a707.tar.gz stable-diffusion-webui-gfx803-f0a917c990c93668b7c1ca814340f3405054a707.tar.bz2 stable-diffusion-webui-gfx803-f0a917c990c93668b7c1ca814340f3405054a707.zip |
Merge pull request #8425 from vladlearns/master
feat: auto update all extensions using flag
Diffstat (limited to 'launch.py')
-rw-r--r-- | launch.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -161,7 +161,15 @@ def git_clone(url, dir, name, commithash=None): if commithash is not None:
run(f'"{git}" -C "{dir}" checkout {commithash}', None, "Couldn't checkout {name}'s hash: {commithash}")
-
+def git_pull_recursive(dir):
+ for subdir, _, _ in os.walk(dir):
+ if os.path.exists(os.path.join(subdir, '.git')):
+ try:
+ output = subprocess.check_output(['git', '-C', subdir, 'pull', '--autostash'])
+ print(f"Pulled changes for repository in '{subdir}':\n{output.decode('utf-8').strip()}\n")
+ except subprocess.CalledProcessError as e:
+ print(f"Couldn't perform 'git pull' on repository in '{subdir}':\n{e.output.decode('utf-8').strip()}\n")
+
def version_check(commit):
try:
import requests
@@ -247,6 +255,7 @@ def prepare_environment(): args, _ = parser.parse_known_args(sys.argv)
sys.argv, _ = extract_arg(sys.argv, '-f')
+ sys.argv, update_all_extensions = extract_arg(sys.argv, '--update-all-extensions')
sys.argv, skip_torch_cuda_test = extract_arg(sys.argv, '--skip-torch-cuda-test')
sys.argv, skip_python_version_check = extract_arg(sys.argv, '--skip-python-version-check')
sys.argv, reinstall_xformers = extract_arg(sys.argv, '--reinstall-xformers')
@@ -312,6 +321,9 @@ def prepare_environment(): if update_check:
version_check(commit)
+
+ if update_all_extensions:
+ git_pull_recursive(dir_extensions)
if "--exit" in sys.argv:
print("Exiting because of --exit argument")
|