#!/usr/bin/env bash set -euo pipefail APP_HOME="${COINHUNTER_APP_HOME:-$HOME/.local/share/coinhunter-cli}" VENV_DIR="$APP_HOME/venv" BIN_DIR="${COINHUNTER_BIN_DIR:-$HOME/.local/bin}" LAUNCHER="$BIN_DIR/coinhunter" PYTHON_BIN="${PYTHON:-}" if [[ -z "$PYTHON_BIN" ]]; then if command -v python3 >/dev/null 2>&1; then PYTHON_BIN="$(command -v python3)" elif command -v python >/dev/null 2>&1; then PYTHON_BIN="$(command -v python)" else echo "error: python3/python not found in PATH" >&2 exit 1 fi fi mkdir -p "$APP_HOME" "$BIN_DIR" "$PYTHON_BIN" -m venv "$VENV_DIR" "$VENV_DIR/bin/python" -m pip install --upgrade pip setuptools wheel "$VENV_DIR/bin/python" -m pip install --upgrade "$(pwd)" cat >"$LAUNCHER" <