-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·57 lines (50 loc) · 1.18 KB
/
setup.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
#!/bin/bash
SETUP_FILE_NAME="setup.sh"
PRE_SETUP_FILE_NAME="setup.pre.sh"
POST_SETUP_FILE_NAME="setup.post.sh"
git submodule init
git submodule update
# Determine the OS type
unameout="$(uname -s)"
platform="unknown"
case "${unameout}" in
Linux*) platform="ubuntu" ;;
Darwin*) platform="macosx" ;;
CYGWIN*) platform="cygwin" ;;
MINGW*) ;;
*) ;;
esac
if [ "${platform}" = "unknown" ]; then
echo "Sorry, your OS (${unameout}) is not supported yet!"
exit -1
fi
# Pre steps for setting up, mainly for App installation
presetup="platforms/${platform}/${PRE_SETUP_FILE_NAME}"
if [ -f ${presetup} ]; then
echo "Pre-setup for ${platform}"
sh ${presetup}
else
echo "No need to do pre-setup for ${platform}"
fi
pushd .
cd common
for conf in `ls -d */ | cut -f1 -d'/'`; do
cd $conf
setupfile=./${SETUP_FILE_NAME}
if [ -f $setupfile ];
then
sh $setupfile
else
echo "Skip $conf"
fi
cd ..
done
popd
# Post steps for setting up, configuration for App preferences
postsetup="platforms/${platform}/${POST_SETUP_FILE_NAME}"
if [ -f ${postsetup} ]; then
echo "Post-setup for ${platform}"
sh ${postsetup}
else
echo "No need to do post-setup for ${platform}"
fi