forked from robotology-playground/robotology-superbuild
-
Notifications
You must be signed in to change notification settings - Fork 3
/
switch-all.sh
executable file
·46 lines (37 loc) · 1.09 KB
/
switch-all.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
#!/bin/bash
ROBOTOLOGY_ROOT=$(readlink --canonicalize --no-newline $(dirname $(readlink --canonicalize --no-newline $BASH_SOURCE))/..)
. $ROBOTOLOGY_ROOT/robotology-setup.bash
if [ $# -ne 1 ]; then
echo "Error: switch-all.sh accepts exactly one input parameter, the branch name"
exit 1
fi
echo
echo "switch-all will switch branches for all local projects to branch $1"
echo
echo
cd ${ROBOTOLOGY_ROOT}
git fetch --all
git checkout -b $1 origin/$1
git checkout $1
if [ -d ${ROBOTOLOGY_ROOT}/robots ]; then
for PROJ_NAME in `ls ${ROBOTOLOGY_ROOT}/robots`;
do
if [ -d ${WALKMAN_ROOT}/robots/${PROJ_NAME}/.git ]; then
cd ${WALKMAN_ROOT}/robots/$PROJ_NAME
echo -n "Checking out branch $1 of $PROJ_NAME ... "
git fetch --all
git checkout -b $1 origin/$1
git checkout $1
echo "done"
else
echo "Error: folder $PROJ_NAME is not a git repository"
fi
done
else
echo "Error: could not find folder ${WALKMAN_ROOT}/robots"
fi
cd ${WALKMAN_ROOT}
mkdir -p build
cd build
cmake ..
make update-all