mirror of
https://github.com/skoelle/wt32sc01-dashboard.git
synced 2026-09-17 17:30:25 +00:00
Phase 7: add Windows .cmd equivalents for build/deploy scripts
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
cd /d "%~dp0\.."
|
||||||
|
set VENV_DIR=.venv-platformio
|
||||||
|
where py >nul 2>nul
|
||||||
|
if %errorlevel%==0 (set PYTHON_CMD=py -3) else (set PYTHON_CMD=python)
|
||||||
|
if not exist "%VENV_DIR%" (
|
||||||
|
echo Creating local virtualenv in %VENV_DIR% using: %PYTHON_CMD%
|
||||||
|
%PYTHON_CMD% -m venv "%VENV_DIR%"
|
||||||
|
if not exist "%VENV_DIR%\Scripts\python.exe" (
|
||||||
|
echo.
|
||||||
|
echo ERROR: Could not create a Python 3 virtualenv.
|
||||||
|
echo Make sure Python 3 is installed from https://www.python.org/downloads/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
"%VENV_DIR%\Scripts\python.exe" -m pip install --upgrade pip
|
||||||
|
"%VENV_DIR%\Scripts\pip.exe" install platformio
|
||||||
|
)
|
||||||
|
echo Running build (no upload) ...
|
||||||
|
"%VENV_DIR%\Scripts\pio.exe" run
|
||||||
|
if errorlevel 1 (echo Build FAILED. & exit /b 1)
|
||||||
|
echo Build finished successfully.
|
||||||
|
endlocal
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
cd /d "%~dp0\.."
|
||||||
|
set VENV_DIR=.venv-platformio
|
||||||
|
where py >nul 2>nul
|
||||||
|
if %errorlevel%==0 (set PYTHON_CMD=py -3) else (set PYTHON_CMD=python)
|
||||||
|
if not exist "%VENV_DIR%" (
|
||||||
|
echo Creating local virtualenv in %VENV_DIR% using: %PYTHON_CMD%
|
||||||
|
%PYTHON_CMD% -m venv "%VENV_DIR%"
|
||||||
|
if not exist "%VENV_DIR%\Scripts\python.exe" (
|
||||||
|
echo.
|
||||||
|
echo ERROR: Could not create a Python 3 virtualenv.
|
||||||
|
echo Make sure Python 3 is installed from https://www.python.org/downloads/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
"%VENV_DIR%\Scripts\python.exe" -m pip install --upgrade pip
|
||||||
|
"%VENV_DIR%\Scripts\pip.exe" install platformio
|
||||||
|
)
|
||||||
|
set PIO=%VENV_DIR%\Scripts\pio.exe
|
||||||
|
if "%~1"=="" (
|
||||||
|
echo Auto-detecting upload port...
|
||||||
|
"%PIO%" run --target upload
|
||||||
|
) else (
|
||||||
|
echo Using forced upload port: %~1
|
||||||
|
"%PIO%" run --target upload --upload-port %~1
|
||||||
|
)
|
||||||
|
if errorlevel 1 (echo Deploy FAILED. & exit /b 1)
|
||||||
|
echo Build + flash complete.
|
||||||
|
endlocal
|
||||||
Reference in New Issue
Block a user