forked from aug0211/aug0211-LoopFollow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildLoopFollow.sh
127 lines (115 loc) · 3.41 KB
/
BuildLoopFollow.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# !/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
PURPLE='\033[0;35m'
BOLD='\033[1m'
NC='\033[0m'
REPO=https://github.com/jonfawcett/LoopFollow
clear
echo -e "\n\n--------------------------------\n\nWelcome to Loop Follow. This script will assist you in downloading and building the app. Before you begin, please ensure that you have Xcode installed and your phone is plugged into your computer\n\n--------------------------------\n\n"
echo -e "Type 1 and hit enter to begin.\nType 2 and hit enter to cancel."
options=("Continue" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"Continue")
break
;;
"Cancel")
echo -e "\n${RED}User cancelled!${NC}";
exit 0
break
;;
*)
esac
done
clear
echo -e "Please select which version of Loop Follow you would like to download and build. Dev branch has the latest features but may contain more bugs.\n\nType the number 1 or 2 and hit enter to select the branch.\nType 3 and hit enter to cancel.\n\n"
options=("Main Branch" "Dev Branch" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"Main Branch")
FOLDERNAME=LoopFollow-Main
BRANCH=Main
break
;;
"Dev Branch")
FOLDERNAME=LoopFollow-Dev
BRANCH=dev
break
;;
"Cancel")
echo -e "\n${RED}User cancelled!${NC}";
exit 0
break
;;
*)
esac
done
clear
echo -e "Would you like to delete prior downloads of Loop Follow before proceeding?\n\n"
echo -e "Type 1 and hit enter to delete.\nType 2 and hit enter to continue without deleting.\n\n"
options=("Delete old downloads" "Do not delete old downloads")
select opt in "${options[@]}"
do
case $opt in
"Delete old downloads")
rm -rf ~/Downloads/BuildLoopFollow/*
break
;;
"Do not delete old downloads")
break
;;
*)
esac
done
clear
echo -e "The code will now begin downloading. The files will be saved in your Downloads folder and Xcode will automatically open when the download is complete.\n\n"
echo -e "Type 1 and hit enter to begin downloading.\nType 2 and hit enter to cancel.\n\n"
options=("Continue" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"Continue")
break
;;
"Cancel")
echo -e "\n${RED}User cancelled!${NC}";
exit 0
break
;;
*)
esac
done
clear
LOOP_BUILD=$(date +'%y%m%d-%H%M')
LOOP_DIR=~/Downloads/BuildLoopFollow/$FOLDERNAME-$LOOP_BUILD
mkdir ~/Downloads/BuildLoopFollow/
mkdir $LOOP_DIR
cd $LOOP_DIR
pwd
clear
echo -e "\n\n Downloading Loop Follow to your Downloads folder.\n--------------------------------\n"
git clone --branch=$BRANCH --recurse-submodules $REPO
echo -e "--------------------------------\n\nIf there are no errors listed above, code has successfully downloaded.\n"
echo -e "Type 1 and hit enter to open Xcode. You may close the terminal after Xcode opens\n\n"
options=("Continue" "Cancel")
select opt in "${options[@]}"
do
case $opt in
"Continue")
break
;;
"Cancel")
echo -e "\n${RED}User cancelled!${NC}";
exit 0
break
;;
*)
esac
done
cd LoopFollow
Echo Open xcode
xed ./LoopFollow.xcworkspace
exit