-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdateSubmodules.sh
executable file
·46 lines (35 loc) · 1.11 KB
/
updateSubmodules.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
# !/bin/bash
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Submodule (plugin) update script #
# #
# AUTHOR Mario Behrendt #
# VERSION 0.1 #
# COPYRIGHT 2011 Mario Behrendt #
# SINCE 28.05.2011 #
# # # # # # # # # # # # # # # # # # # # # # # # # # #
BASEDIR=`pwd`
LOGFILE=update.log
DATE=`date`
clear
echo "Updating submodules"
echo $DATE > $BASEDIR/$LOGFILE
echo "" >> $BASEDIR/$LOGFILE
for SUBMODULE in `ls bundle`; do
cd bundle/$SUBMODULE
echo "Submodule $SUBMODULE" >> $BASEDIR/$LOGFILE
echo "==============================" >> $BASEDIR/$LOGFILE
git checkout master >> $BASEDIR/$LOGFILE 2>&1
git pull >> $BASEDIR/$LOGFILE 2>&1
echo "" >> $BASEDIR/$LOGFILE
cd $BASEDIR
echo ".\c"
done
echo ""
echo "Done"
echo "Remove update log in $BASEDIR/$LOGFILE? [Y/n]"
read -n 1 -s ANSWER
if ([ "" == "$ANSWER" ] || [ "Y" == "$ANSWER" ] || [ "y" == "$ANSWER" ]); then
rm -f $BASEDIR/$LOGFILE
echo "Log deleted"
fi
exit 0