mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Exit scripts when try to update non-git installs
This commit is contained in:
		| @@ -2,9 +2,15 @@ | |||||||
| pushd %~dp0 | pushd %~dp0 | ||||||
| git --version > nul 2>&1 | git --version > nul 2>&1 | ||||||
| if %errorlevel% neq 0 ( | if %errorlevel% neq 0 ( | ||||||
|     echo Git is not installed on this system. Skipping update. |     echo [91mGit is not installed on this system.[0m | ||||||
|     echo If you installed with a zip file, you will need to download the new zip and install it manually. |     echo Install it from https://git-scm.com/downloads | ||||||
|  |     goto end | ||||||
| ) else ( | ) else ( | ||||||
|  |     if not exist .git ( | ||||||
|  |         echo [91mNot running from a Git repository. Reinstall using an officially supported method to get updates.[0m | ||||||
|  |         echo See: https://docs.sillytavern.app/installation/windows/ | ||||||
|  |         goto end | ||||||
|  |     ) | ||||||
|     call git pull --rebase --autostash |     call git pull --rebase --autostash | ||||||
|     if %errorlevel% neq 0 ( |     if %errorlevel% neq 0 ( | ||||||
|         REM incase there is still something wrong |         REM incase there is still something wrong | ||||||
| @@ -14,5 +20,6 @@ if %errorlevel% neq 0 ( | |||||||
| set NODE_ENV=production | set NODE_ENV=production | ||||||
| call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev | call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev | ||||||
| node server.js %* | node server.js %* | ||||||
|  | :end | ||||||
| pause | pause | ||||||
| popd | popd | ||||||
|   | |||||||
| @@ -5,8 +5,14 @@ pushd %~dp0 | |||||||
| echo Checking Git installation | echo Checking Git installation | ||||||
| git --version > nul 2>&1 | git --version > nul 2>&1 | ||||||
| if %errorlevel% neq 0 ( | if %errorlevel% neq 0 ( | ||||||
|     echo Git is not installed on this system. Skipping update. |     echo [91mGit is not installed on this system.[0m | ||||||
|     echo If you installed with a zip file, you will need to download the new zip and install it manually. |     echo Install it from https://git-scm.com/downloads | ||||||
|  |     goto end | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | if not exist .git ( | ||||||
|  |     echo [91mNot running from a Git repository. Reinstall using an officially supported method to get updates.[0m | ||||||
|  |     echo See: https://docs.sillytavern.app/installation/windows/ | ||||||
|     goto end |     goto end | ||||||
| ) | ) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user