reformatted to use my template
This commit is contained in:
17
scripts/windows/install.bat
Normal file
17
scripts/windows/install.bat
Normal file
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
|
||||
@REM change to ccurrent directory
|
||||
cd %~f0\..\..\..\
|
||||
|
||||
@REM discord token
|
||||
if not exist "token.txt" copy NUL "token.txt"
|
||||
|
||||
for /f %%i in ("token.txt") do set size=%%~zi
|
||||
if %size% equ 0 (
|
||||
set /p token="Enter your discord bot token: "
|
||||
echo | set /p=%id% > "token.txt"
|
||||
)
|
||||
|
||||
@REM run
|
||||
npm install
|
||||
npm run build
|
||||
28
scripts/windows/start.bat
Normal file
28
scripts/windows/start.bat
Normal file
@@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
|
||||
@Rem change to current directory
|
||||
cd %~f0\..\..\..\
|
||||
|
||||
@Rem make log folder
|
||||
if not exist log mkdir log
|
||||
|
||||
@Rem current file number
|
||||
set /A num=0
|
||||
if exist log\number set /p num=<log\number
|
||||
|
||||
echo %num > log\number
|
||||
|
||||
@Rem watchdog
|
||||
:watchdog
|
||||
|
||||
@Rem increment log file number
|
||||
set /A num=num+1
|
||||
echo %num > log\number
|
||||
|
||||
@Rem run
|
||||
powershell "npm start 2> log\%num%.err | tee log\%num%.out"
|
||||
|
||||
@Rem give chance to close program
|
||||
timeout /t 5 /nobreak
|
||||
|
||||
goto watchdog
|
||||
Reference in New Issue
Block a user