This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sh
executable file
·138 lines (113 loc) · 3.35 KB
/
init.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
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
embedded_platforms=(xatkit-core xatkit-chat xatkit-slack xatkit-discord xatkit-react xatkit-giphy xatkit-github xatkit-log xatkit-twitter xatkit-alexa xatkit-zapier)
embedded_libraries=(xatkit-core)
xatkit_org=https://github.com/xatkit-bot-platform
if [ -z "$XATKIT_DEV" ]
then
echo "XATKIT_DEV environment variable not set, please run the install script"
exit 1
fi
echo "Initializing Xatkit development environment at $XATKIT_DEV"
cd $XATKIT_DEV
if [ -d $XATKIT_DEV/src/xatkit ]
then
echo "Skipping initialization of Xatkit Parent, there is already a xatkit directory in your development environment ($XATKIT_DEV/src/xatkit)"
else
cd $XATKIT_DEV/src
echo "Cloning Xatkit Parent"
git clone $xatkit_org/xatkit.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/xatkit.git"
exit 1
fi
fi
if [ -d $XATKIT_DEV/src/xatkit-metamodels ]
then
echo "Skipping initialization of Xatkit Metamodels, there is already a xatkit-metamodels directory in your development environment ($XATKIT_DEV/src/xatkit-metamodels)"
else
cd $XATKIT_DEV/src
echo "Cloning Xatkit Metamodels"
git clone $xatkit_org/xatkit-metamodels.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/xatkit-metamodels.git"
exit 1
fi
fi
if [ -d $XATKIT_DEV/src/xatkit-runtime ]
then
echo "Skipping initialization of Xatkit Runtime, there is already a xatkit-runtime directory in your development environment ($XATKIT_DEV/src/xatkit-runtime)"
else
cd $XATKIT_DEV/src
echo "Cloning Xatkit"
git clone $xatkit_org/xatkit-runtime.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/xatkit.git"
exit 1
fi
fi
if [ -d $XATKIT_DEV/src/xatkit-eclipse ]
then
echo "Skipping initialization of Xatkit Eclipse, there is already a xatkit-eclipse directory in your development environment ($XATKIT_DEV/src/xatkit-eclipse)"
else
echo "Cloning Xatkit Eclipse Plugins"
git clone $xatkit_org/xatkit-eclipse.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/xatkit-eclipse.git"
exit 1
fi
fi
if [ -d $XATKIT_DEV/src/xatkit-examples ]
then
echo "Skipping initialization of Xatkit Examples, there is already a xatkit-examples directory in your development environment ($XATKIT_DEV/src/xatkit-examples)"
else
echo "Cloning Xatkit Examples"
git clone $xatkit_org/xatkit-examples
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/xatkit-examples"
exit 1
fi
fi
if [ ! -d $XATKIT_DEV/src/platforms ]
then
echo "Creating $XATKIT_DEV/src/platforms directory"
mkdir -p $XATKIT_DEV/src/platforms
fi
cd $XATKIT_DEV/src/platforms
echo "Initializing platforms"
for platform in "${embedded_platforms[@]}"
do
project_name="$platform-platform"
if [ -d $XATKIT_DEV/src/platforms/$project_name ]
then
echo "Skipping initialization of $project_name, the directory already exists"
else
echo "Cloning $project_name"
git clone $xatkit_org/$project_name.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/$project_name.git"
fi
fi
done
mkdir -p $XATKIT_DEV/src/libraries
cd $XATKIT_DEV/src/libraries
for library in "${embedded_libraries[@]}"
do
project_name="$library-library"
if [ -d $XATKIT_DEV/src/libraries/$project_name ]
then
echo "Skipping initialization of $project_name, the directory already exists"
else
echo "Cloning $project_name"
git clone $xatkit_org/$project_name.git
if [ $? -ne 0 ]
then
echo "Cannot clone $xatkit_org/$project_name.git"
fi
fi
done