Skip to content

Commit

Permalink
Fixed ST Update Log Match | Tabby API Updater Streamlined.
Browse files Browse the repository at this point in the history
Fixed ST launch match on update function.
Changed Tabby API update process so confusing instructions are surpressed
  • Loading branch information
BlueprintCoding committed Aug 20, 2024
1 parent 2316eba commit 9ba0172
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions Launcher.bat
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,24 @@ if %errorlevel% neq 0 (
pause
goto :update_manager_text_completion
)
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Updating tabbyAPI Dependencies in a new window...
start cmd /k "title UPDATE TABBYAPI && cd /d %tabbyapi_install_path% && python start.py --update-deps && echo  WARNING: DO NOT FOLLOW INSTRUCTIONS FROM ABOVE BECAUSE THAT IS ONLY FOR USERS THAT DID NOT USE SILLYTAVERN-LAUNCHER TO INSTALL TABBYAPI. UPDATE INSTALLED, YOU CAN CLOSE THIS WINDOW NOW."
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Updating tabbyAPI Dependencies...

echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%tabbyAPI updated successfully.%reset%
REM Run the update process and log the output
python start.py --update-deps > tabby_update_log.txt 2>&1

REM Scan the log file for the specific success message
findstr /c:"Dependencies updated. Please run TabbyAPI" tabby_update_log.txt >nul
if %errorlevel% == 0 (
echo [INFO] TabbyAPI Updated
) else (
echo [ERROR] TabbyAPI Update Failed
)

REM Delete the log file
del tabby_update_log.txt

REM Continue with the rest of the script
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%tabbyAPI update process complete.%reset%
pause
goto :update_manager_text_completion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Log file found, scan

:loop
REM Use PowerShell to search for the error message
powershell -Command "try { $content = Get-Content '%logs_st_console_path%' -Raw; if ($content -match 'Error: Cannot find module') { exit 1 } elseif ($content -match 'SillyTavern is listening on:') { exit 0 } else { exit 2 } } catch { exit 2 }"
powershell -Command "try { $content = Get-Content '%logs_st_console_path%' -Raw; if ($content -match 'Error: Cannot find module') { exit 1 } elseif ($content -match 'SillyTavern is listening' -or $content -match 'Go to' -or $content -match '\[\s*\r?\n\s*\x27') { exit 0 } else { exit 2 } } catch { exit 2 }"
set "ps_errorlevel=%errorlevel%"

if %ps_errorlevel% equ 0 (
Expand Down

0 comments on commit 9ba0172

Please sign in to comment.