Files
retro-alcoi/setup-quake/build.sh
T
2026-03-16 10:17:30 +01:00

28 lines
865 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Navigate to setup-quake/ regardless of where we're called from
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Activate virtualenv if present, otherwise require pyinstaller in PATH
if [[ -f .venv/bin/activate ]]; then
source .venv/bin/activate
echo "Activated .venv"
elif ! command -v pyinstaller &>/dev/null; then
echo "Error: pyinstaller not found. Either create a .venv or install pyinstaller." >&2
echo " python3 -m venv .venv && .venv/bin/pip install -r requirements.txt" >&2
exit 1
fi
echo "Building setup-quake binary..."
pyinstaller --onefile --clean --name setup-quake setup_quake.py
echo "Copying config.ini to dist/..."
cp config.ini dist/
echo ""
echo "Build complete. Output:"
echo " ${SCRIPT_DIR}/dist/setup-quake"
echo " ${SCRIPT_DIR}/dist/config.ini"