- scripts/bootstrap.sh: setup idempotente (python>=3.10, venv, extras, ffmpeg/node con hints de brew/apt, config.yaml desde example) - scripts/start-server.sh / stop-server.sh: equivalentes bash de los .ps1 (reuso de servidor via .run/server.info, puerto libre 8000-8100, healthz, apertura de navegador con open/xdg-open) - Makefile: setup/serve/stop/test/clean (Windows apunta a los .bat/.ps1) - compatible con bash 3.2 de macOS, sin bashismos
45 lines
1.2 KiB
Makefile
45 lines
1.2 KiB
Makefile
# yt-scraper — atajos para macOS/Linux (y test/clean multiplataforma).
|
|
#
|
|
# macOS trae `make` de fabrica, asi que un Mac nuevo queda sirviendo con:
|
|
# make setup && make serve
|
|
# En Windows estos targets solo orientan: usa los .bat / .ps1 del proyecto
|
|
# (start-server.bat, stop-server.bat, scripts/doctor.ps1).
|
|
|
|
# En Windows (GNU make define OS=Windows_NT) los scripts .sh no aplican.
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
setup:
|
|
@echo [Windows] Los scripts .sh son para macOS/Linux. Usa scripts\doctor.ps1 o instala a mano: pip install -e ".[dev,web,analysis]"
|
|
|
|
serve:
|
|
@echo [Windows] Usa start-server.bat
|
|
|
|
stop:
|
|
@echo [Windows] Usa stop-server.bat
|
|
|
|
test:
|
|
uv run python -m pytest -q || python -m pytest -q
|
|
|
|
else
|
|
|
|
setup:
|
|
@bash scripts/bootstrap.sh
|
|
|
|
serve:
|
|
@bash scripts/start-server.sh
|
|
|
|
stop:
|
|
@bash scripts/stop-server.sh
|
|
|
|
test:
|
|
@if command -v uv >/dev/null 2>&1; then uv run python -m pytest -q; else python -m pytest -q; fi
|
|
|
|
endif
|
|
|
|
# Borra solo caches de Python; no toca datos, venv ni .run/.
|
|
clean:
|
|
@find . -path ./.venv -prune -o -path ./.venv-312 -prune -o -type d \( -name __pycache__ -o -name .pytest_cache \) -prune -exec rm -rf {} +
|
|
@echo caches eliminadas.
|
|
|
|
.PHONY: setup serve stop test clean
|