#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ -n "${PYTHON:-}" ]; then PYTHON_BIN="$PYTHON" elif command -v python >/dev/null 2>&1; then PYTHON_BIN="python" else PYTHON_BIN="python3" fi cd "$ROOT" "$PYTHON_BIN" -m PyInstaller --noconfirm --clean tjwater.spec BIN_PATH="$ROOT/dist/" if [ ! -x "$BIN_PATH" ]; then echo "build succeeded but executable was not created: $BIN_PATH" >&2 exit 1 fi "$BIN_PATH" help >/dev/null echo "built executable: $BIN_PATH"