28 lines
875 B
Bash
Executable File
28 lines
875 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Navigate to setup-network/ 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-network binary..."
|
|
pyinstaller --onefile --clean --name setup-network setup_network.py
|
|
|
|
echo "Copying config.ini to dist/..."
|
|
cp config.ini dist/
|
|
|
|
echo ""
|
|
echo "Build complete. Output:"
|
|
echo " ${SCRIPT_DIR}/dist/setup-network"
|
|
echo " ${SCRIPT_DIR}/dist/config.ini"
|