-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoracle
More file actions
executable file
·79 lines (69 loc) · 2.05 KB
/
Copy pathoracle
File metadata and controls
executable file
·79 lines (69 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
# The Oracle - one-stop manager for Linux/macOS.
#
# ./oracle install set up the venv, register launchers, verify (doctor)
# ./oracle start launch the desktop GUI
# ./oracle update refresh an existing install (keeps Input/, Seashells/,
# Profiles/, Output/, and your saved settings)
# ./oracle uninstall remove launchers and the local venv
#
# Each command delegates to the same managed installer the per-action scripts
# use, so behavior matches install_oracle_tts.sh / run_oracle_tts.sh exactly.
set -Eeuo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
select_python() {
local candidate
for candidate in python3.12 python3.11 python3; do
if ! command -v "$candidate" >/dev/null 2>&1; then
continue
fi
if "$candidate" - <<'PY' >/dev/null 2>&1
import sys
raise SystemExit(0 if (3, 11) <= sys.version_info[:3] < (3, 13) else 1)
PY
then
printf '%s' "$candidate"
return 0
fi
done
return 1
}
show_help() {
cat <<'EOF'
The Oracle - manager
./oracle install Set up the venv, register launchers, run the doctor.
./oracle start Launch the desktop GUI.
./oracle update Refresh an existing install (your data is kept).
./oracle uninstall Remove launchers and the local venv.
./oracle doctor Diagnostics only.
./oracle bootstrap Venv + dependencies without desktop integration.
./oracle help Show this message.
EOF
}
main() {
local action="${1:-help}"
case "$action" in
install|start|update|uninstall|doctor|bootstrap|run|gui)
shift || true
;;
help|-h|--help)
show_help
exit 0
;;
*)
echo "Unknown action: $action" >&2
show_help >&2
exit 1
;;
esac
if [ "$action" = "start" ]; then
action="run"
fi
local python_bin
if ! python_bin="$(select_python)"; then
printf 'FAIL: Need Python 3.11 or 3.12 with venv support.\n' >&2
exit 1
fi
exec "$python_bin" "$REPO_ROOT/scripts/manage_install.py" "$action" "$@"
}
main "$@"