-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·55 lines (46 loc) · 1.31 KB
/
setup.sh
File metadata and controls
executable file
·55 lines (46 loc) · 1.31 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
#!/bin/bash
set -e
SETUP_DIR="$(dirname "$0")/setup"
if [[ ! -d "$SETUP_DIR" ]]; then
echo "Error: setup directory not found at $SETUP_DIR"
exit 1
fi
scripts=($(find "$SETUP_DIR" -name "*.sh" -type f | sort))
if [[ ${#scripts[@]} -eq 0 ]]; then
echo "No .sh scripts found in $SETUP_DIR"
exit 0
fi
echo "Found ${#scripts[@]} scripts in setup directory"
echo
for script in "${scripts[@]}"; do
script_name=$(basename "$script")
while true; do
read -p "Execute $script_name? [y/n/q]: " choice
case $choice in
[Yy])
echo "Running $script_name..."
if bash "$script"; then
echo "✓ $script_name completed successfully"
else
echo "✗ $script_name failed (exit code $?)"
read -p "Continue with remaining scripts? [y/n]: " cont
[[ $cont =~ ^[Nn] ]] && exit 1
fi
break
;;
[Nn])
echo "Skipping $script_name"
break
;;
[Qq])
echo "Quitting"
exit 0
;;
*)
echo "Please answer y, n, or q"
;;
esac
done
echo
done
echo "Setup complete"