-
Notifications
You must be signed in to change notification settings - Fork 4
/
svnup.sh
43 lines (42 loc) · 1.13 KB
/
svnup.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
#!/bin/sh
cd `dirname $0`
pwd=`pwd`
date=`date +%Y%m%d%H%M%S`
log="$pwd/svnup.log"
errorlog="$pwd/svnuperror.log"
function isok() {
ret=$1
action="$2"
[[ $ret -ne 0 ]] && echo "ERROR!!!!,$action" && echo "ERROR!!!!, $action" >> $log && exit 1
echo "OK!!!!,$action" && echo "OK!!!!, $action" >> $log && return 0
}
function docmd() {
cmd=$1
echo $cmd
echo $cmd >> $log
echo $cmd >> $errorlog
eval "$cmd 1>>$log 2>>$errorlog"
isok $? "$cmd"
}
echo "install begin:$date" > $log
echo "install begin:$date" > $errorlog
echo $pwd | grep branches > /dev/null
if [[ $? -eq 0 ]]; then
version="dev"
else
version=""
fi
if [[ $version == "dev" ]]; then
docmd "svn up"
docmd "svn up ../../../luxianres/branches/test826/csv"
docmd "svn up ../../../luxianres/branches/test826/code"
docmd "svn up ../../../luxianres/branches/test826/GameWindows4.2.0"
else
docmd "svn up"
docmd "svn up ../../../luxianres/trunk/csv"
docmd "svn up ../../../luxianres/trunk/code"
docmd "svn up ../../../luxianres/trunk/GameWindows4.2.0"
fi
date=`date +%Y%m%d%H%M%S`
echo "install end:$date" >> $log
echo "install end:$date" >> $errorlog