Skip to content

Commit

Permalink
Support running as a git submodule. (oobabooga#5227)
Browse files Browse the repository at this point in the history
  • Loading branch information
acdvorak authored and PoetOnTheRun committed Feb 22, 2024
1 parent 6f16fe2 commit 7c98e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions one_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def install_webui():

def update_requirements(initial_installation=False):
# Create .git directory if missing
if not os.path.isdir(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'
run_cmd(git_creation_cmd, environment=True, assert_success=True)

Expand All @@ -268,7 +268,7 @@ def update_requirements(initial_installation=False):
]

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 origin main", assert_success=True, environment=True)
after_pull_hashes = {file_name: calculate_file_hash(file_name) for file_name in files_to_check}

# Check for differences in installation file hashes
Expand Down

0 comments on commit 7c98e2e

Please sign in to comment.