afegit setup-network

This commit is contained in:
2026-03-16 09:56:32 +01:00
parent b705ad1b63
commit 773fb30ee6
7 changed files with 337 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/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"