Files
SillyTavern-Launcher/log_wrapper.bat
Blueprint Coding 9082699cc7 Added ST node server logging and automatic fixing for Node Module Errors
Logs ST node server console output to file, scans the log for node module errors, if found prompts user to run the troubleshooter for an auto-fix
2024-07-05 16:26:44 -06:00

25 lines
684 B
Batchfile

@echo off
setlocal
REM Define the path to the log file
set LOG_FILE=..\bin\st_console_output.log
REM Set necessary environment variables for Node.js
set NODE_ENV=production
REM Determine the command to run
if "%1"=="ssl" (
set NODE_CMD=node server.js --ssl
) else (
set NODE_CMD=node server.js
)
REM Start the Node.js server and log the output using PowerShell Tee-Object, suppressing specific warnings
echo Starting Node.js server with command: %NODE_CMD%
powershell -Command "& {%NODE_CMD% 2>&1 | Where-Object {$_ -notmatch 'Security has been overridden'} | Tee-Object -FilePath '%LOG_FILE%'}"
echo Node.js server started.
pause
REM Pause to keep the window open
pause