/
PetrovSA
/
python-dev-course
Обзор
Документация
Войти
/
PetrovSA
/
python-dev-course
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Part 8 - FastAPI/BooksAPI_UI_Start/clean_project.bat
66 строк
2 KB
PetrovSerega
Initial commit
08 май 2026, 17:14
08 май 2026, 17:14
9e45db8
Код
Авторство
О чём код?
@echo off echo --- Starting project cleanup for distribution --- :: 1. Remove Python bytecode cache directories recursively for /d /r . %%d in (__pycache__) do @if exist "%%d" ( echo Deleting cache: %%d rd /s /q "%%d" 2>nul ) :: 2. Remove All Virtual Environments (.venv, .venv1, venv, etc.) echo Searching for virtual environments... for /f "delims=" %%d in ('dir /s /ad /b .venv* venv* 2^>nul') do ( if exist "%%d" ( echo Removing: "%%d" rd /s /q "%%d" 2>nul ) ) :: 3. Remove SQLite database files echo Deleting local SQLite databases... for /f "delims=" %%f in ('dir /s /b *.db 2^>nul') do ( del /f /q "%%f" >nul 2>&1 ) :: 4. Remove VS Code settings echo Removing VS Code settings... if exist .vscode rd /s /q .vscode 2>nul for /f "delims=" %%d in ('dir /s /ad /b .vscode 2^>nul') do ( if exist "%%d" rd /s /q "%%d" 2>nul ) :: 5. Remove Pytest cache echo Removing Pytest cache... if exist .pytest_cache rd /s /q .pytest_cache 2>nul for /f "delims=" %%d in ('dir /s /ad /b .pytest_cache 2^>nul') do ( if exist "%%d" rd /s /q "%%d" 2>nul ) :: 6. Remove Coverage data file (.coverage) echo Deleting coverage data... if exist .coverage del /f /q .coverage >nul 2>&1 for /f "delims=" %%f in ('dir /s /b .coverage 2^>nul') do ( del /f /q "%%f" >nul 2>&1 ) :: 7. Remove Coverage HTML report folder (htmlcov) echo Removing Coverage HTML reports... if exist htmlcov rd /s /q htmlcov 2>nul for /f "delims=" %%d in ('dir /s /ad /b htmlcov 2^>nul') do ( if exist "%%d" ( echo Removing: "%%d" rd /s /q "%%d" 2>nul ) ) :: 8. Remove Custom Files (downloaded.bin, etc.) echo Removing custom files... for %%f in (downloaded.bin) do ( if exist "%%f" del /f /q "%%f" 2>nul for /f "delims=" %%p in ('dir /s /b "%%f" 2^>nul') do ( if exist "%%p" del /f /q "%%p" 2>nul ) ) echo Cleanup complete! pause