19 lines
669 B
Bash
19 lines
669 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
python_cmd="${CODEX_IMAGEGEN_PYTHON:-}"
|
|
if [[ -z "$python_cmd" ]]; then
|
|
embedded_python="$HOME/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/python.exe"
|
|
if [[ -x "$embedded_python" ]]; then
|
|
python_cmd="$embedded_python"
|
|
else
|
|
python_cmd="$(command -v python3 || command -v python || true)"
|
|
fi
|
|
fi
|
|
if [[ -z "$python_cmd" ]]; then
|
|
printf '%s\n' "Python 3 not found; install Python or set CODEX_IMAGEGEN_PYTHON." >&2
|
|
exit 1
|
|
fi
|
|
runtime="$($python_cmd "$script_dir/runtime.py" --keyring)"
|
|
exec "$runtime" "$script_dir/generate_image.py" "$@"
|