first commit
This commit is contained in:
5
scripts/app_launcher.sh
Executable file
5
scripts/app_launcher.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
exec "$ROOT/scripts/run_proxy_god.sh"
|
||||
38
scripts/find_tk_python.sh
Executable file
38
scripts/find_tk_python.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
candidates=(
|
||||
"${PYTHON:-}"
|
||||
"/usr/local/bin/python3"
|
||||
"/Library/Frameworks/Python.framework/Versions/Current/bin/python3"
|
||||
"/Library/Frameworks/Python.framework/Versions/3.13/bin/python3"
|
||||
"/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
|
||||
"/usr/bin/python3"
|
||||
"/opt/homebrew/bin/python3"
|
||||
"python3"
|
||||
)
|
||||
|
||||
seen=""
|
||||
for py in "${candidates[@]}"; do
|
||||
[[ -n "$py" ]] || continue
|
||||
if [[ "$py" != /* ]]; then
|
||||
resolved="$(command -v "$py" 2>/dev/null || true)"
|
||||
else
|
||||
resolved="$py"
|
||||
fi
|
||||
[[ -x "$resolved" ]] || continue
|
||||
case ":$seen:" in
|
||||
*":$resolved:"*) continue ;;
|
||||
esac
|
||||
seen="$seen:$resolved"
|
||||
if "$resolved" - <<'PY' >/dev/null 2>&1
|
||||
import tkinter
|
||||
PY
|
||||
then
|
||||
printf '%s\n' "$resolved"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No Python with tkinter support found. Install Python from python.org or a Tk-enabled Python runtime." >&2
|
||||
exit 1
|
||||
26
scripts/run_proxy_god.sh
Executable file
26
scripts/run_proxy_god.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
TK_PY="$("$ROOT/scripts/find_tk_python.sh")"
|
||||
|
||||
needs_rebuild=0
|
||||
if [[ ! -x ".venv/bin/python" ]]; then
|
||||
needs_rebuild=1
|
||||
elif ! ".venv/bin/python" - <<'PY' >/dev/null 2>&1
|
||||
import tkinter
|
||||
PY
|
||||
then
|
||||
needs_rebuild=1
|
||||
fi
|
||||
|
||||
if [[ "$needs_rebuild" == "1" ]]; then
|
||||
rm -rf .venv
|
||||
"$TK_PY" -m venv .venv
|
||||
fi
|
||||
|
||||
".venv/bin/python" -m pip install --upgrade pip >/dev/null
|
||||
".venv/bin/python" -m pip install -r requirements.txt >/dev/null
|
||||
exec ".venv/bin/python" run.py
|
||||
Reference in New Issue
Block a user