-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmaintenance_loop.sh
More file actions
31 lines (22 loc) · 814 Bytes
/
Copy pathmaintenance_loop.sh
File metadata and controls
31 lines (22 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
# Safe maintenance loop — hygiene + Python tests only.
# Does NOT delete worktrees or native-android scripts (prior version was hazardous).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$REPO_ROOT"
LOG_FILE="logs/maintenance_$(date +%Y%m%d).log"
mkdir -p logs
exec > >(tee -a "$LOG_FILE") 2>&1
echo "--- Maintenance loop (safe): $(date -u +"%Y-%m-%dT%H:%M:%SZ") ---"
echo "==> Hygiene check"
bash scripts/shell/hygiene-check.sh
echo "==> Repo metrics"
bash scripts/shell/metrics_repo.sh
echo "==> Python unit tests (scripts/)"
if command -v uv >/dev/null 2>&1; then
uv run pytest scripts/tests/ -q --tb=no
else
python3 -m pytest scripts/tests/ -q --tb=no
fi
echo "--- Maintenance loop complete ---"