mirror of
https://github.com/skoelle/m5stack-dashboard.git
synced 2026-09-17 16:50:23 +00:00
fix windows scripts
This commit is contained in:
+21
-3
@@ -8,10 +8,28 @@ cd /d "%~dp0\.."
|
||||
|
||||
set VENV_DIR=.venv-platformio
|
||||
|
||||
REM Prefer the "py" launcher (ships with official Python installer) which
|
||||
REM reliably picks Python 3, even if "python" on PATH points to an old
|
||||
REM Python 2.x install.
|
||||
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% ...
|
||||
python -m venv "%VENV_DIR%"
|
||||
"%VENV_DIR%\Scripts\pip.exe" install --upgrade pip
|
||||
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/
|
||||
echo and that "py -3 --version" or "python --version" reports Python 3.x
|
||||
echo ^(your "python" currently points to: %PYTHON_CMD%^)
|
||||
exit /b 1
|
||||
)
|
||||
"%VENV_DIR%\Scripts\python.exe" -m pip install --upgrade pip
|
||||
"%VENV_DIR%\Scripts\pip.exe" install platformio
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user