forked from minvws/nl-covid19-coronacheck-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·48 lines (40 loc) · 1.22 KB
/
bootstrap.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
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
CLEAR_LINE='\r\033[K'
# Exit if any subcommand fails
set -e
# Check install script dependencies
if ! command -v bundle > /dev/null; then
printf "${CLEAR_LINE}❌${RED} You must install bundler on your system before setup can continue${NO_COLOR}\n"
printf "${YELLOW}You could try running 'gem install bundler'${NO_COLOR}\n"
exit -1
fi
# Install optional (but recommended) project dependencies
if command -v brew > /dev/null; then
if ! command -v swiftlint > /dev/null; then
printf "Installing swiftlint via brew... "
if brew update > /dev/null && brew install swiftlint > /dev/null; then
printf "${GREEN}[ok]${NO_COLOR}\n"
else
printf "${RED}[fail]${NO_COLOR}\n"
fi
fi
fi
# Install ruby dependencies
printf "Installing gems via bundler... "
if bundle install --quiet; then
printf "${GREEN}[ok]${NO_COLOR}\n"
else
exit -1
fi
# Install pods via cocoapods
printf "Installing pods via cocoapods... "
if bundle exec pod repo update --silent && bundle exec pod install --silent; then
printf "${GREEN}[ok]${NO_COLOR}\n"
else
exit -1
fi
printf "\n${CLEAR_LINE}${GREEN}All done! Everything seems a-okay 👌${NO_COLOR}\n"