mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Don't git pull on "Install/update extensions requirements"
This commit is contained in:
parent
fbe83854ca
commit
2d74660733
@ -317,20 +317,21 @@ def install_extensions_requirements():
|
|||||||
run_cmd(f"python -m pip install -r {extension_req_path} --upgrade", assert_success=False, environment=True)
|
run_cmd(f"python -m pip install -r {extension_req_path} --upgrade", assert_success=False, environment=True)
|
||||||
|
|
||||||
|
|
||||||
def update_requirements(initial_installation=False):
|
def update_requirements(initial_installation=False, pull=True):
|
||||||
# Create .git directory if missing
|
# Create .git directory if missing
|
||||||
if not os.path.exists(os.path.join(script_dir, ".git")):
|
if not os.path.exists(os.path.join(script_dir, ".git")):
|
||||||
git_creation_cmd = 'git init -b main && git remote add origin https://github.com/oobabooga/text-generation-webui && git fetch && git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main && git reset --hard origin/main && git branch --set-upstream-to=origin/main'
|
git_creation_cmd = 'git init -b main && git remote add origin https://github.com/oobabooga/text-generation-webui && git fetch && git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main && git reset --hard origin/main && git branch --set-upstream-to=origin/main'
|
||||||
run_cmd(git_creation_cmd, environment=True, assert_success=True)
|
run_cmd(git_creation_cmd, environment=True, assert_success=True)
|
||||||
|
|
||||||
|
if pull:
|
||||||
|
print_big_message("Updating the local copy of the repository with \"git pull\"")
|
||||||
|
|
||||||
files_to_check = [
|
files_to_check = [
|
||||||
'start_linux.sh', 'start_macos.sh', 'start_windows.bat', 'start_wsl.bat',
|
'start_linux.sh', 'start_macos.sh', 'start_windows.bat', 'start_wsl.bat',
|
||||||
'update_linux.sh', 'update_macos.sh', 'update_windows.bat', 'update_wsl.bat',
|
'update_linux.sh', 'update_macos.sh', 'update_windows.bat', 'update_wsl.bat',
|
||||||
'one_click.py'
|
'one_click.py'
|
||||||
]
|
]
|
||||||
|
|
||||||
print_big_message("Updating the local copy of the repository with \"git pull\"")
|
|
||||||
|
|
||||||
before_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
before_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
||||||
run_cmd("git pull --autostash", assert_success=True, environment=True)
|
run_cmd("git pull --autostash", assert_success=True, environment=True)
|
||||||
after_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
after_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}
|
||||||
@ -427,7 +428,7 @@ if __name__ == "__main__":
|
|||||||
update_requirements()
|
update_requirements()
|
||||||
elif choice == 'B':
|
elif choice == 'B':
|
||||||
install_extensions_requirements()
|
install_extensions_requirements()
|
||||||
update_requirements()
|
update_requirements(pull=False)
|
||||||
elif choice == 'C':
|
elif choice == 'C':
|
||||||
run_cmd("git reset --hard", assert_success=True, environment=True)
|
run_cmd("git reset --hard", assert_success=True, environment=True)
|
||||||
elif choice == 'N':
|
elif choice == 'N':
|
||||||
|
Loading…
Reference in New Issue
Block a user