refactor: finish facade migration for precheck and executor
This commit is contained in:
35
scripts/install_local.sh
Executable file
35
scripts/install_local.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/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" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
exec "$VENV_DIR/bin/coinhunter" "\$@"
|
||||
EOF
|
||||
chmod +x "$LAUNCHER"
|
||||
|
||||
echo "Installed coinhunter into:"
|
||||
echo " venv: $VENV_DIR"
|
||||
echo " launcher: $LAUNCHER"
|
||||
Reference in New Issue
Block a user