-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathBuildSelectScript.sh
More file actions
105 lines (88 loc) · 3.03 KB
/
BuildSelectScript.sh
File metadata and controls
105 lines (88 loc) · 3.03 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash # script BuildSelectScript.sh
#!inline common.sh
#!inline build_warning.sh
#!inline run_script.sh
#!inline utility_scripts.sh
# Set default values only if they haven't been defined as environment variables
: ${SCRIPT_BRANCH:="main"}
function placeholder() {
section_divider
echo -e " The feature is not available, coming soon"
echo -e " This is a placeholder"
return
}
############################################################
# The rest of this is specific to the particular script
############################################################
FIRST_TIME="1"
SKIP_OPEN_SOURCE_WARNING="0"
function first_time_menu() {
section_separator
echo -e "${INFO_FONT}Welcome to the Loop and Learn\n Build-Select Script\n${NC}"
echo "Choose from one of these options:"
echo " 1 Download and Build Loop"
echo " 2 Download and Build Related Apps"
echo " 3 Run Maintenance Utilities"
echo " 4 Run Customization Select"
echo " 5 Exit Script"
echo ""
echo "After completing a given option, you can choose another or exit the script"
FIRST_TIME="0"
}
############################################################
# Welcome & What to do selection
############################################################
while true; do
if [ "${FIRST_TIME}" = "1" ]; then
first_time_menu
fi
section_divider
options=(\
"Build Loop" \
"Build Related Apps" \
"Maintenance Utilities" \
"Customization Select" \
"Exit Script")
actions=(\
"WHICH=Loop" \
"WHICH=OtherApps" \
"WHICH=UtilityScripts" \
"WHICH=CustomizationScripts" \
"exit_script")
menu_select "${options[@]}" "${actions[@]}"
if [ "$WHICH" = "Loop" ]; then
# Issue Warning if not done previously
open_source_warning
run_script "BuildLoop.sh" $CUSTOM_BRANCH
elif [ "$WHICH" = "OtherApps" ]; then
# Issue Warning if not done previously
open_source_warning
section_separator
echo -e "Select the app you want to build"
echo -e " Each selection will indicate documentation links"
echo -e " Please read the documentation before using the app"
echo -e ""
options=(\
"Build Loop Follow" \
"Build LoopCaregiver" \
"Build xDrip4iOS" \
"Return to Menu")
actions=(\
"WHICH=LoopFollow" \
"WHICH=LoopCaregiver" \
"WHICH=xDrip4iOS" \
return)
menu_select "${options[@]}" "${actions[@]}"
if [ "$WHICH" = "LoopFollow" ]; then
run_script "BuildLoopFollow.sh" $CUSTOM_BRANCH
elif [ "$WHICH" = "LoopCaregiver" ]; then
run_script "BuildLoopCaregiver.sh" $CUSTOM_BRANCH
elif [ "$WHICH" = "xDrip4iOS" ]; then
run_script "BuildxDrip4iOS.sh" $CUSTOM_BRANCH
fi
elif [ "$WHICH" = "UtilityScripts" ]; then
utility_scripts
else
run_script "CustomizationSelect.sh" $CUSTOM_BRANCH
fi
done