-
Notifications
You must be signed in to change notification settings - Fork 36
/
bootstrap.sh
executable file
·84 lines (69 loc) · 1.82 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
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
#!/bin/sh
# set -euo pipefail
# Install "Command line tools" xcode-select --install
# Install Homebrew -> https://brew.sh
# Parse options
usage() {
echo "Usage: $0 [additional options]"
echo
echo " Options:"
echo
echo " --skip-cocoapods - Skip pod install"
echo " --update-submodule - Git submodule update with --remote option"
exit 1;
}
OPT_COCOAPODS=true
OPT_SUBMODULE=false
while test $# -gt 0
do
case "$1" in
--skip-cocoapods)
OPT_COCOAPODS=false
;;
--update-submodule)
OPT_SUBMODULE=true
;;
*)
usage 1>&2
;;
esac
shift
done
echo "🔜 Check & Install dependencies..."
if which -a brew > /dev/null; then
echo "🟢 Homebrew installed. Skipping install"
else
echo "🔴 Homebrew not installed. Start install"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
if which -a mint > /dev/null; then
echo "🟢 Mint installed. Skipping install"
else
echo "🔴 Mint not installed. Start install"
brew install mint
fi
if [ "${CI}" = true ] ; then
MINTFILE="./Utilites/Mintfile@ci"
else
MINTFILE="./Utilites/Mintfile@local"
fi
echo "🔄 Mint bootstrap dependencies"
mint bootstrap --mintfile ${MINTFILE}
echo "✅ Dependencies succesfully installed"
if [ "${CI}" = true ] ; then
echo "ℹ️ Skipping SwiftFormat"
else
echo "🚀 Running SwiftFormat"
mint run [email protected] . --config .swiftformat
fi
echo "🚀 Running SwiftGen"
mint run [email protected] config run --config swiftgen.yml
if [ "$OPT_COCOAPODS" = true ] ; then
echo "🚀 Running pod install"
pod install --repo-update
fi
if [ "$OPT_SUBMODULE" = true ] ; then
echo "🚀 Running submodule remote update"
git submodule update --remote
fi
echo "Bootstrap competed 🎉"