From 6bbfc40d10a7d2e671558a2f928285b6744c4a3c Mon Sep 17 00:00:00 2001 From: jllllll <3887729+jllllll@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:51:58 -0500 Subject: [PATCH] Add .git creation to installer --- webui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 8707e7f7..f30c59a0 100644 --- a/webui.py +++ b/webui.py @@ -117,7 +117,12 @@ def install_dependencies(): def update_dependencies(initial_installation=False): - # run_cmd("git pull", assert_success=True, environment=True) # TODO uncomment before merging (is there a better way?) + # Create .git directory if missing + if not os.path.isdir(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 remote set-head origin -a && git reset origin/HEAD && git branch --set-upstream-to=origin/HEAD' + run_cmd(git_creation_cmd, environment=True, assert_success=True) + + run_cmd("git pull", assert_success=True, environment=True) # TODO is there a better way? # Install the extensions dependencies (only on the first install) if initial_installation: