39 lines
1.4 KiB
Bash
Executable File
39 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd -- "${ROOT}"
|
|
|
|
echo "==> Rejecting Python source/runtime dependencies"
|
|
if find .. -type f -name '*.py' -print -quit | grep -q .; then
|
|
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"
|
|
if LC_ALL=C grep -n $'\r' start.sh >/dev/null 2>&1; then
|
|
echo "ERROR: start.sh contains CR/CRLF line endings" >&2
|
|
exit 1
|
|
fi
|
|
chmod +x start.sh fix-port.sh
|
|
bash -n start.sh
|
|
bash -n fix-port.sh
|
|
if command -v shellcheck >/dev/null 2>&1; then shellcheck start.sh fix-port.sh; fi
|
|
|
|
command -v dotnet >/dev/null 2>&1 || { echo "ERROR: dotnet SDK is required" >&2; exit 1; }
|
|
dotnet --info
|
|
dotnet build CommonwealthOnline.Server.csproj -c Release --nologo
|
|
dotnet run --project tests/CommonwealthOnline.Server.Tests.csproj -c Release
|
|
|
|
echo "All C# Linux compatibility checks passed."
|