29 lines
490 B
Batchfile
29 lines
490 B
Batchfile
@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 |