-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
60 lines (50 loc) · 1.42 KB
/
install.sh
File metadata and controls
60 lines (50 loc) · 1.42 KB
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
#!/bin/sh
# If you call this script from within another script
# it might be necessary to use an absolute path.
# Otherwise there might be problems resolving the
# path to config.sh
source ./config.sh
function clone-repository-into-dir {
echo "----------------------------------"
cd $1 # change to destination directory
echo $PWD
echo ""
if [ -z "$3" ]
then
git clone $2 # normal git clone
else
git clone $2 $3 # clone repo ($2) with folder name ($3)
fi
}
function create-recursive-dir {
mkdir -p $1
}
function create-dir-if-non-existent {
if [ ! -d "$1" ]
then
create-recursive-dir $1
fi
}
function create-parent-dirs-and-clone-repository {
create-dir-if-non-existent $1
clone-repository-into-dir $1 $2 $3
}
function clone-openease {
create-parent-dirs-and-clone-repository $OPENEASE_PARENT_DIR $OPENEASE_REPO $OPENEASE
}
function clone-knowrob {
create-parent-dirs-and-clone-repository $KNOWROB_PARENT_DIR $KNOWROB_REPO $KNOWROB
}
function clone-dockerbridge {
create-parent-dirs-and-clone-repository $DOCKERBRIDGE_PARENT_DIR $DOCKERBRIDGE_REPO $DOCKERBRIDGE
}
# ---------------------------------------------------------------
if [ -z "$OPENEASE_ROOT_DIR" ]
then
echo "Path to workspace is not set."
echo "Please set it and re-run this script."
else
clone-openease
clone-knowrob
clone-dockerbridge
fi