-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathupVer
executable file
·53 lines (47 loc) · 1.19 KB
/
upVer
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
49
50
51
52
#!/bin/bash
# release
#
#{{IS_NOTE
# Purpose:
#
# Description:
#
# History:
# Tue Mar 3 11:11:09 2011, Created by Jimmy
#}}IS_NOTE
#
#Copyright (C) 2011 Potix Corporation. All Rights Reserved.
#
#{{IS_RIGHT
#}}IS_RIGHT
#
maindir="$(pwd)"
echo "Working directory $maindir"
oldVersion=$1
newVersion=$2
isFL=$3
if [ "$oldVersion" == "" ] || [ "$newVersion" == "" ] ; then
echo "Usage: upVer [ oldVersion ] [ newVersion ] [options]"
echo "Available options: FL."
exit 1
fi
function upVer {
if [ "$isFL" == "FL" ] ; then
targetVersion=$newVersion"-SNAPSHOT"
else
targetVersion=$newVersion
fi
sed -i "/version>/,/<\//s/>$oldVersion.*<\//>$targetVersion<\//" $1/pom.xml
echo "$1 pom.xml"
grep -n --color=auto $targetVersion $1/pom.xml
echo "$1 config.xml"
find $1/src -name config.xml -exec sed -i "
/<version/,/\/version>/s/>$oldVersion.*<\//>$newVersion<\//g
" {} \; -exec grep -n --color=auto $newVersion {} \;
echo "$1 Version.java"
find $1/src -name Version.java -exec sed -i "
s/UID = \"$oldVersion.*\";/UID = \"$newVersion\";/g
" {} \; -exec grep -n --color=auto $newVersion {} \;
}
upVer zkspring-core
upVer zkspring-security