-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_app.sh
executable file
·72 lines (66 loc) · 2.25 KB
/
run_app.sh
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
#!/bin/bash
source ./config/constants.sh
help_message_install_software() {
echo
echo "Choosen script to install softwares!"
echo "Possible flags are:"
# Display grouped flags with descriptions, aligned in columns
for action in "${!FLAG_GROUPS[@]}"; do
case "$action" in
"all")
printf " %-*s %s\n" "$COLUMN_WIDTH" "${FLAG_GROUPS[$action]}" "# Install all software tools without prompts"
;;
"all-excluding")
printf " %-*s %s\n" "$COLUMN_WIDTH" "${FLAG_GROUPS[$action]} [software...]" "# Install all except specified software"
;;
"install")
printf " %-*s %s\n" "$COLUMN_WIDTH" "${FLAG_GROUPS[$action]} [software...]" "# Specify software to install (use one or more names)"
;;
"help")
printf " %-*s %s\n" "$COLUMN_WIDTH" "${FLAG_GROUPS[$action]}" "# Show this help message"
;;
esac
done
echo
echo "With the following software tools available:"
# Display software tools with descriptions, aligned in columns
for software in "${!SOFTWARE_DETAILS[@]}"; do
printf " %-*s %s\n" "$COLUMN_WIDTH" "$software" "${DESCRIPTION_SOFTWARE_LIST[$software]}"
done
echo
echo "Example usage:"
printf " %-*s %s\n" "$COLUMN_WIDTH" "-ax Brave Docker" "# Install all except Brave and Docker"
printf " %-*s %s\n" "$COLUMN_WIDTH" "-i Brave Docker" "# Install only Brave and Docker"
echo
echo "CTRL+C to exit"
}
# Display menu for user to choose actions
echo "Welcome to the setup script!"
echo "1. Install Software"
echo "2. Generate README"
echo "3. Verify Constants"
echo "4. Exit"
read -p "Choose an option [1-4]: " choice
case $choice in
1)
# Print the help function of the install_softwares.sh script
help_message_install_software
read -p "Input: " flags
echo "You chose: $flags"
# Pass the flags to the install_softwares.sh script
./bin/install_softwares.sh "$flags"
;;
2)
./bin/auto_gen_readme.sh
;;
3)
./bin/verify_constants.sh
;;
4)
echo "Goodbye!"
exit 0
;;
*)
echo "Invalid option!"
;;
esac