mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Add make.ps1 cmdlet + activateenv command for Windows make scripts (#4087)
* Add missing command to `make.bat`'s help * Add `activateenv` and `deactivateenv` commands to `make.bat` * Add help to `Makefile` * Add `make.ps1` cmdlet
This commit is contained in:
28
make.bat
28
make.bat
@@ -2,31 +2,32 @@
|
||||
|
||||
if [%1] == [] goto help
|
||||
|
||||
REM This allows us to expand variables at execution
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
|
||||
goto %1
|
||||
|
||||
:reformat
|
||||
black "%~dp0."
|
||||
exit /B %ERRORLEVEL%
|
||||
"%~dp0.venv\Scripts\black" "%~dp0."
|
||||
goto:eof
|
||||
|
||||
:stylecheck
|
||||
black --check "%~dp0."
|
||||
exit /B %ERRORLEVEL%
|
||||
"%~dp0.venv\Scripts\black" --check "%~dp0."
|
||||
goto:eof
|
||||
|
||||
:stylediff
|
||||
black --check --diff "%~dp0."
|
||||
exit /B %ERRORLEVEL%
|
||||
"%~dp0.venv\Scripts\black" --check --diff "%~dp0."
|
||||
goto:eof
|
||||
|
||||
:newenv
|
||||
py -3.8 -m venv --clear .venv
|
||||
.\.venv\Scripts\python -m pip install -U pip setuptools wheel
|
||||
"%~dp0.venv\Scripts\python" -m pip install -U pip setuptools wheel
|
||||
goto syncenv
|
||||
|
||||
:syncenv
|
||||
.\.venv\Scripts\python -m pip install -Ur .\tools\dev-requirements.txt
|
||||
exit /B %ERRORLEVEL%
|
||||
"%~dp0.venv\Scripts\python" -m pip install -Ur .\tools\dev-requirements.txt
|
||||
goto:eof
|
||||
|
||||
:activateenv
|
||||
CALL "%~dp0.venv\Scripts\activate.bat"
|
||||
goto:eof
|
||||
|
||||
:help
|
||||
echo Usage:
|
||||
@@ -35,6 +36,9 @@ echo.
|
||||
echo Commands:
|
||||
echo reformat Reformat all .py files being tracked by git.
|
||||
echo stylecheck Check which tracked .py files need reformatting.
|
||||
echo stylediff Show the post-reformat diff of the tracked .py files
|
||||
echo without modifying them.
|
||||
echo newenv Create or replace this project's virtual environment.
|
||||
echo syncenv Sync this project's virtual environment to Red's latest
|
||||
echo dependencies.
|
||||
echo activateenv Activates project's virtual environment.
|
||||
|
||||
Reference in New Issue
Block a user