| 2 | pushd %~dp0 | 2 | pushd %~dp0 |
| 3 | git --version > nul 2>&1 | 3 | git --version > nul 2>&1 |
| 4 | if %errorlevel% neq 0 ( | 4 | if %errorlevel% neq 0 ( |
| 5 | echo Git is not installed on this system. Skipping update. | 5 | echo [91mGit is not installed on this system.[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 | ) else ( | 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 | call git pull --rebase --autostash | 14 | call git pull --rebase --autostash |
| 9 | if %errorlevel% neq 0 ( | 15 | if %errorlevel% neq 0 ( |
| 10 | REM incase there is still something wrong | 16 | REM incase there is still something wrong |
| 11 | echo There were errors while updating. Please download the latest version manually. | 17 | echo [91mThere were errors while updating.[0m |
| | 18 | echo See the update FAQ at https://docs.sillytavern.app/usage/update/#common-update-problems |
| | 19 | goto end |
| 12 | ) | 20 | ) |
| 13 | ) | 21 | ) |
| 14 | set NODE_ENV=production | 22 | set NODE_ENV=production |
| 15 | call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev | 23 | call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev |
| 16 | node server.js %* | 24 | node server.js %* |
| | 25 | :end |
| 17 | pause | 26 | pause |
| 18 | popd | 27 | popd |