Make files - fallback to python(3.8) from PATH if .venv doesn't exist (#4863)

This commit is contained in:
jack1142
2021-02-28 15:39:28 +01:00
committed by GitHub
parent 1ff976b3d0
commit 9bb61ba882
3 changed files with 30 additions and 12 deletions

View File

@@ -2,18 +2,24 @@
if [%1] == [] goto help
if exist "%~dp0.venv\" (
set "VENV_PYTHON=%~dp0.venv\Scripts\python"
) else (
set VENV_PYTHON=python
)
goto %1
:reformat
"%~dp0.venv\Scripts\black" "%~dp0."
"%VENV_PYTHON%" -m black "%~dp0."
goto:eof
:stylecheck
"%~dp0.venv\Scripts\black" --check "%~dp0."
"%VENV_PYTHON%" -m black --check "%~dp0."
goto:eof
:stylediff
"%~dp0.venv\Scripts\black" --check --diff "%~dp0."
"%VENV_PYTHON%" -m black --check --diff "%~dp0."
goto:eof
:newenv