Exit scripts when try to update non-git installs
| @@ -2,9 +2,15 @@ | ||
| 2 | 2 | pushd %~dp0 |
| 3 | 3 | git --version > nul 2>&1 |
| 4 | 4 | if %errorlevel% neq 0 ( |
| 5 | 5 | echo Git[91mGit is not installed on this system. Skipping update.[0m |
| 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 | 8 | ) else ( |
| 9 | + if not exist .git ( | |
| 10 | + echo [91mNot running from a Git repository. Reinstall using an officially supported method to get updates.[0m | |
| 11 | + echo See: https://docs.sillytavern.app/installation/windows/ | |
| 12 | + goto end | |
| 13 | + ) | |
| 8 | 14 | call git pull --rebase --autostash |
| 9 | 15 | if %errorlevel% neq 0 ( |
| 10 | 16 | REM incase there is still something wrong |
| @@ -14,5 +20,6 @@ if %errorlevel% neq 0 ( | ||
| 14 | 20 | set NODE_ENV=production |
| 15 | 21 | call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev |
| 16 | 22 | node server.js %* |
| 23 | +:end | |
| 17 | 24 | pause |
| 18 | 25 | popd |
| @@ -5,8 +5,14 @@ pushd %~dp0 | ||
| 5 | 5 | echo Checking Git installation |
| 6 | 6 | git --version > nul 2>&1 |
| 7 | 7 | if %errorlevel% neq 0 ( |
| 8 | 8 | echo Git[91mGit is not installed on this system. Skipping update.[0m |
| 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 | + | |
| 13 | +if not exist .git ( | |
| 14 | + echo [91mNot running from a Git repository. Reinstall using an officially supported method to get updates.[0m | |
| 15 | + echo See: https://docs.sillytavern.app/installation/windows/ | |
| 10 | 16 | goto end |
| 11 | 17 | ) |
| 12 | 18 | |