Update update_script.py

This commit is contained in:
Saifeddine ALOUI 2023-11-08 15:39:08 +01:00 committed by GitHub
parent f819db0d41
commit 1799694537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import git
import subprocess
import argparse
from pathlib import Path
from ascii_colors import ASCIIColors, trace_exception
def run_git_pull():
try:
@ -27,6 +28,27 @@ def run_git_pull():
except Exception as ex:
print(f"Couldn't checkout module {submodule}")
execution_path = Path(os.getcwd())
# Clone the repository to the target path
ASCIIColors.info("Lollms_core found in the app space.\nPulling last lollms_core")
subprocess.run(["git", "-C", str(execution_path/"lollms_core"), "pull"])
subprocess.run(["git", "-C", str(execution_path/"utilities/safe_store"), "pull"])
# Pull the repository if it already exists
ASCIIColors.info("Bindings zoo found in your personal space.\nPulling last personalities zoo")
subprocess.run(["git", "-C", self.lollms_paths.bindings_zoo_path, "pull"])
# Pull the repository if it already exists
ASCIIColors.info("Personalities zoo found in your personal space.\nPulling last personalities zoo")
subprocess.run(["git", "-C", self.lollms_paths.personalities_zoo_path, "pull"])
# Pull the repository if it already exists
ASCIIColors.info("Extensions zoo found in your personal space.\nPulling last Extensions zoo")
subprocess.run(["git", "-C", self.lollms_paths.extensions_zoo_path, "pull"])
# Pull the repository if it already exists
ASCIIColors.info("Models zoo found in your personal space.\nPulling last Models zoo")
subprocess.run(["git", "-C", self.lollms_paths.models_zoo_path, "pull"])
except Exception as ex:
print("Couldn't update submodules")
print(ex)