-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.sh
More file actions
executable file
·78 lines (65 loc) · 1.68 KB
/
Copy pathstartup.sh
File metadata and controls
executable file
·78 lines (65 loc) · 1.68 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
#!/usr/bin/env bash
# Crucible startup menu using gum
set -euo pipefail
banner() {
clear || true
cat <<'EOF'
_____ _ _ _
/ ____| (_) | | |
| | _ __ _ _ ___ _| |__ | | ___
| | | '__| | | |/ __| | '_ \| |/ _ \
| |____| | | |_| | (__| | |_) | | __/
\_____|_| \__,_|\___|_|_.__/|_|\___|
EOF
echo
}
banner
if ! command -v gum >/dev/null 2>&1; then
echo "[crucible][error] gum not found. Run install.sh first." >&2
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
launch_script() {
local script="$1"
local target="${SCRIPT_DIR}/install/${script}"
if [[ -x "$target" ]]; then
"$target"
elif [[ -f "$target" ]]; then
bash "$target"
else
gum style --foreground 196 "Missing script: install/${script}"
return 1
fi
}
main_menu() {
banner
local choice
choice=$(gum choose --header "Crucible Startup Menu" \
"Core services (php, caddy, mysql)" \
"Framework (Laravel, Next)" \
"Docker Management" \
"Exit") || exit 0
case "$choice" in
"Core services (php, caddy, mysql)")
gum style --foreground 212 --bold "Launching Core Services installer"
launch_script coreservice.sh || true
;;
"Framework (Laravel, Next)")
gum style --foreground 45 --bold "Launching Framework installer"
launch_script framework.sh || true
;;
"Docker Management")
gum style --foreground 39 --bold "Opening Docker Management"
launch_script operation/docker.sh || true
;;
Exit)
echo "Bye"; exit 0 ;;
esac
}
while true; do
main_menu
echo
gum confirm "Return to main menu?" || break
echo
done
echo "[crucible] Finished."