-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathrepositories_update.bash
executable file
·49 lines (38 loc) · 1.53 KB
/
repositories_update.bash
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
#!/usr/bin/env bash
reset_ws=${1:-true}
catkin_ws_path=${2:-"$HOME/catkin_ws_drl"}
repositories_dirs=${3:-"dynamic_robot_localization pose_to_tf_publisher laserscan_to_pointcloud mesh_to_pointcloud pcl pcl_msgs perception_pcl"}
echo -e "\n\n"
echo "####################################################################################################"
echo "##### Updating git repositories..."
if [ "${reset_ws}" = true ] ; then
echo "##### git reset --hard HEAD will be performed before pulling"
fi
echo -e "####################################################################################################\n"
cd "${catkin_ws_path}/src/" &> /dev/null
if [ $? -ne 0 ]; then
echo "==============================================================="
echo -e "==> Missing workspace directory (${catkin_ws_path}/src/)!\n\n"
exit -1
fi
for git_repository in ${repositories_dirs}
do
cd "${git_repository}" &> /dev/null
if [ $? -eq 0 ]; then
echo -e "\n\n-------------------------------------------"
echo "==> Updating ${git_repository}"
if [ "${reset_ws}" = true ] ; then
git reset --hard HEAD
fi
git pull
cd ..
fi
done
cd "${catkin_ws_path}"
find ./src -name "*.bash" -exec chmod +x {} \;
find ./src -name "*.cfg" -exec chmod +x {} \;
find ./src -name "*.sh" -exec chmod +x {} \;
echo -e "\n\n"
echo "----------------------------------------------------------------------------------------------------"
echo ">>>>> Update finished"
echo "----------------------------------------------------------------------------------------------------"