Centralize legacy runtime checks in Linux validation

This commit is contained in:
Nomads_Reach
2026-08-16 02:57:42 -04:00
parent 6282323b12
commit 7267782084
+7 -17
View File
@@ -4,31 +4,21 @@ set -Eeuo pipefail
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
cd -- "${ROOT}" cd -- "${ROOT}"
echo "==> Rejecting Python source/runtime dependencies" echo "==> Enforcing repository runtime policy"
if find .. -type f -name '*.py' -print -quit | grep -q .; then bash scripts/verify-no-legacy-runtime.sh
find .. -type f -name '*.py' -print
echo "ERROR: Python source files are not allowed in CO-SERVER." >&2
exit 1
fi
if find . -maxdepth 1 -type f -name 'requirements*.txt' -print -quit | grep -q .; then
find . -maxdepth 1 -type f -name 'requirements*.txt' -print
echo "ERROR: Python requirements files are not allowed." >&2
exit 1
fi
if grep -RInE --exclude-dir=.git --exclude='*.md' --exclude='PORT_TROUBLESHOOTING.txt' '(python3?|\.venv|pip install|consumer_server_cli\.py)' ..; then
echo "ERROR: Python runtime references remain in executable/configuration files." >&2
exit 1
fi
echo "==> Checking shell scripts" echo "==> Checking shell scripts"
if LC_ALL=C grep -n $'\r' start.sh >/dev/null 2>&1; then if LC_ALL=C grep -n $'\r' start.sh >/dev/null 2>&1; then
echo "ERROR: start.sh contains CR/CRLF line endings" >&2 echo "ERROR: start.sh contains CR/CRLF line endings" >&2
exit 1 exit 1
fi fi
chmod +x start.sh fix-port.sh chmod +x start.sh fix-port.sh scripts/verify-no-legacy-runtime.sh
bash -n start.sh bash -n start.sh
bash -n fix-port.sh bash -n fix-port.sh
if command -v shellcheck >/dev/null 2>&1; then shellcheck start.sh fix-port.sh; fi bash -n scripts/verify-no-legacy-runtime.sh
if command -v shellcheck >/dev/null 2>&1; then
shellcheck start.sh fix-port.sh scripts/verify-no-legacy-runtime.sh
fi
command -v dotnet >/dev/null 2>&1 || { echo "ERROR: dotnet SDK is required" >&2; exit 1; } command -v dotnet >/dev/null 2>&1 || { echo "ERROR: dotnet SDK is required" >&2; exit 1; }
dotnet --info dotnet --info