launcher upgrades

+added ability to clear npm cache
This commit is contained in:
deffcolony
2024-12-02 11:54:49 +01:00
parent 471ddec8c8
commit c5896e497a
3 changed files with 49 additions and 17 deletions

View File

@@ -4387,16 +4387,17 @@ echo %cyan_fg_strong% __________________________________________________________
echo %cyan_fg_strong%^| Troubleshooting ^& Repair Options: ^|%reset%
echo 1. Remove node_modules folder
echo 2. Clear pip cache
echo 3. Fix unresolved conflicts or unmerged files [SillyTavern]
echo 4. Export dxdiag info
echo 5. Find what app is using port
echo 6. Set Onboarding Flow
echo 2. Clear npm cache
echo 3. Clear pip cache
echo 4. Fix unresolved conflicts or unmerged files [SillyTavern]
echo 5. Export dxdiag info
echo 6. Find what app is using port
echo 7. Set Onboarding Flow
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| Support Options: ^|%reset%
echo 7. Report an Issue
echo 8. SillyTavern Documentation
echo 9. Discord servers
echo 8. Report an Issue
echo 9. SillyTavern Documentation
echo 10. Discord servers
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| Menu Options: ^|%reset%
echo 0. Back
@@ -4425,6 +4426,17 @@ if "%troubleshooting_choice%"=="1" (
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="2" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\remove_npm_cache.bat" (
call %troubleshooting_dir%\remove_npm_cache.bat
goto :troubleshooting
) else (
echo [%DATE% %TIME%] ERROR: remove_npm_cache.bat not found in: %troubleshooting_dir% >> %logs_stl_console_path%
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] remove_npm_cache.bat not found in: %troubleshooting_dir%%reset%
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="3" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\remove_pip_cache.bat" (
call %troubleshooting_dir%\remove_pip_cache.bat
@@ -4435,7 +4447,7 @@ if "%troubleshooting_choice%"=="1" (
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="3" (
) else if "%troubleshooting_choice%"=="4" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\fix_github_conflicts.bat" (
call %troubleshooting_dir%\fix_github_conflicts.bat
@@ -4446,7 +4458,7 @@ if "%troubleshooting_choice%"=="1" (
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="4" (
) else if "%troubleshooting_choice%"=="5" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\export_dxdiag.bat" (
call %troubleshooting_dir%\export_dxdiag.bat
@@ -4457,7 +4469,7 @@ if "%troubleshooting_choice%"=="1" (
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="5" (
) else if "%troubleshooting_choice%"=="6" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\find_app_port.bat" (
call %troubleshooting_dir%\find_app_port.bat
@@ -4468,7 +4480,7 @@ if "%troubleshooting_choice%"=="1" (
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="6" (
) else if "%troubleshooting_choice%"=="7" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\onboarding_flow.bat" (
call %troubleshooting_dir%\onboarding_flow.bat
@@ -4479,11 +4491,11 @@ if "%troubleshooting_choice%"=="1" (
pause
goto :troubleshooting
)
) else if "%troubleshooting_choice%"=="7" (
call :issue_report
) else if "%troubleshooting_choice%"=="8" (
call :documentation
call :issue_report
) else if "%troubleshooting_choice%"=="9" (
call :documentation
) else if "%troubleshooting_choice%"=="10" (
set "caller=troubleshooting"
if exist "%troubleshooting_dir%\Support\discord.bat" (
call %troubleshooting_dir%\Support\discord.bat

View File

@@ -0,0 +1,20 @@
@echo off
:remove_npm_cache
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Clearing npm cache...
npm cache clean --force
if %errorlevel% neq 0 (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Could not clear npm cache.%reset%
echo Please try again.
pause
goto :npm_exit
)
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%npm cache cleared successfully.%reset%
pause
:npm_exit
if "%caller%"=="home" (
exit /b 1
) else (
exit /b 0
)

View File

@@ -4,12 +4,12 @@
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Clearing pip cache...
pip cache purge
if %errorlevel% neq 0 (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Could not clear the pip cache.%reset%
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Could not clear pip cache.%reset%
echo Please try again.
pause
goto :pip_exit
)
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%The pip cache has been cleared successfully.%reset%
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%pip cache cleared successfully.%reset%
pause
:pip_exit