-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallup.sh
executable file
·49 lines (35 loc) · 884 Bytes
/
allup.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
47
48
#!/bin/bash
pushd "$1" > /dev/null
PTH=`pwd`
BASENAME='/bin/basename'
GIT_BIN='/usr/bin/git'
SVN_BIN='/usr/bin/svn'
SVN_FOLDER=".svn"
GIT_FOLDER=".git"
SKIP_REPO=".skip"
for REPOSITORY in "$PTH"/*
do
if [[ -d $REPOSITORY ]]
then
if [[ -f $REPOSITORY/$SKIP_REPO ]]
then
echo -e "Ignoring `$BASENAME $REPOSITORY`...\n"
continue;
fi
pushd "$REPOSITORY" > /dev/null
echo -n Updating `$BASENAME $REPOSITORY`...
if [[ -d $REPOSITORY/$SVN_FOLDER ]]
then
echo " [Subversion]"
$SVN_BIN update
fi
if [[ -d $REPOSITORY/$GIT_FOLDER ]]
then
echo " [Git]"
$GIT_BIN pull
fi
echo "";
popd > /dev/null
fi
done
popd > /dev/null