never-away/header.bat
Anri 6b2cd8772f
All checks were successful
Upload release / build (push) Successful in 3s
Actualiser header.bat
2024-08-12 12:57:35 +02:00

29 lines
635 B
Batchfile

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "tmpFile=%TEMP%\~na.py"
CALL :getLine "::python_beg" "::python_end" > "!tmpFile!"
:: Install dependencies
python -m pip install pyautogui >NUL
:: Run the program
PowerShell -Command "Start-Process cmd -Argument '/c START /B python !tmpFile!' -WindowStyle hidden"
EXIT /B
:getLine <beg str> <end str>
SET "bBegEnd=0"
FOR /F "usebackq delims=" %%i IN ("%~f0") do (
IF !bBegEnd! EQU 1 (
IF "%%i" EQU "%~2" ( EXIT /B )
SETLOCAL DISABLEDELAYEDEXPANSION
ECHO %%i
ENDLOCAL
) ELSE (
IF "%%i" EQU "%~1" ( SET "bBegEnd=1" )
)
)
ENDLOCAL
EXIT /B