Exit scripts when try to update non-git installs

6c110e91f7769f0c12990cf12f61875b3daf8989

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +17 -4Showing whitespace changes
UpdateAndStart.bat+9 -2
@@ -2,9 +2,15 @@
2pushd %~dp02pushd %~dp0
3git --version > nul 2>&13git --version > nul 2>&1
4if %errorlevel% neq 0 (4if %errorlevel% neq 0 (
5 echo Git is not installed on this system. Skipping update.5 echo Git is not installed on this system.
6 echo If you installed with a zip file, you will need to download the new zip and install it manually.6 echo Install it from https://git-scm.com/downloads
7 goto end
7) else (8) else (
9 if not exist .git (
10 echo Not running from a Git repository. Reinstall using an officially supported method to get updates.
11 echo See: https://docs.sillytavern.app/installation/windows/
12 goto end
13 )
8 call git pull --rebase --autostash14 call git pull --rebase --autostash
9 if %errorlevel% neq 0 (15 if %errorlevel% neq 0 (
10 REM incase there is still something wrong16 REM incase there is still something wrong
@@ -14,5 +20,6 @@ if %errorlevel% neq 0 (
14set NODE_ENV=production20set NODE_ENV=production
15call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev21call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev
16node server.js %*22node server.js %*
23:end
17pause24pause
18popd25popd
UpdateForkAndStart.bat+8 -2
@@ -5,8 +5,14 @@ pushd %~dp0
5echo Checking Git installation5echo Checking Git installation
6git --version > nul 2>&16git --version > nul 2>&1
7if %errorlevel% neq 0 (7if %errorlevel% neq 0 (
8 echo Git is not installed on this system. Skipping update.8 echo Git is not installed on this system.
9 echo If you installed with a zip file, you will need to download the new zip and install it manually.9 echo Install it from https://git-scm.com/downloads
10 goto end
11)
12
13if not exist .git (
14 echo Not running from a Git repository. Reinstall using an officially supported method to get updates.
15 echo See: https://docs.sillytavern.app/installation/windows/
10 goto end16 goto end
11)17)
1218