forked from isis-project/isis-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·41 lines (33 loc) · 813 Bytes
/
update.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
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -L "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
ISIS_PROJECT="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $ISIS_PROJECT
. ./scripts/common/envsetup.sh
print_usage()
{
echo options:
echo " -t [NAME] : Update only named target"
echo " -g [CMD] : Command to pass to git, defaults to 'pull --all'"
}
GITCMD="pull --all"
SRC="`/bin/ls -1 $ISIS_ROOT`"
while getopts t:g: ARG
do
case "$ARG" in
t) SRC=$OPTARG;;
g) GITCMD=$OPTARG;;
[?]) print_usage
exit -1;;
esac
done
for CURRENT in $SRC ; do
GITREPO=$ISIS_ROOT/$CURRENT
if [ -d $GITREPO/.git ] ; then
echo ===========================
echo "$CURRENT -> git $GITCMD"
cd $GITREPO ; git $GITCMD
fi
done
echo ===========================
echo Done