40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 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)
|
|
echo "./install $mode was removed; run: pipelines harness setup ${mode#--}" >&2
|
|
exit 2
|
|
;;
|
|
--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 "$@"
|
|
;;
|
|
--linux|linux|--macos|macos)
|
|
shift
|
|
exec python3 scripts/app_build.py "${mode#--}" "$@"
|
|
;;
|
|
--native|native)
|
|
shift
|
|
exec python3 scripts/setup-native.py "$@"
|
|
;;
|
|
*) exec python3 scripts/setup-native.py "$@" ;;
|
|
esac
|