Files
pipelines/install.sh
T

37 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
set -eu
cd "$(dirname "$0")"
if ! command -v python3 >/dev/null 2>&1; then
echo "Python 3.9 or newer is required; install it and rerun ./install." >&2
exit 1
fi
python3 -c 'import sys; sys.exit(0 if sys.version_info >= (3, 9) else "Python 3.9 or newer is required")'
mode=${1:-}
case "$mode" in
--opencode|--pi)
harness=${mode#--}
shift
exec python3 scripts/setup-harness.py "$harness" "$@"
;;
--docker|docker)
if [ "$#" -gt 0 ]; then shift; fi
exec python3 scripts/setup-docker.py "$@"
;;
--web|web)
# Rebuild the web app in Docker (reused while app sources are unchanged).
shift
exec python3 scripts/app_build.py web "$@"
;;
--apk|apk)
# The optional Android app: built in Docker with the Android SDK (slower),
# then offered to phones at /updates/ on the web address.
shift
exec python3 scripts/app_build.py apk "$@"
;;
--native|native)
shift
exec python3 scripts/setup-native.py "$@"
;;
*) exec python3 scripts/setup-native.py "$@" ;;
esac