chore: removed scripts and added a flag to launch.py
This commit is contained in:
parent
09c73710c9
commit
b07b7057f0
@ -1 +0,0 @@
|
||||
for /d %%i in (*) do @if exist "%%i\.git" (echo Pulling updates for %%i... & git -C "%%i" pull)
|
@ -1,3 +0,0 @@
|
||||
ls | while read dir; do if [ -d "$dir/.git" ];
|
||||
then echo "Pulling updates for $dir...";
|
||||
git -C "$dir" pull; fi; done
|
12
launch.py
12
launch.py
@ -161,6 +161,14 @@ 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'])
|
||||
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:
|
||||
@ -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')
|
||||
@ -313,6 +322,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")
|
||||
exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user