-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathupVer
108 lines (97 loc) · 2.83 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/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"
stamp=$(date +%Y%m%d)
oldVersion=$1
newVersion=$2
isFL=$3
if [ "$Zats" = "" ] ; then
if [ ! -d "./zats" ] ; then
echo "Zats path is not found!!"
fi
if [ ! -d "./zats-common" ] ; then
echo "zats-common path is not found!!"
fi
if [ ! -d "./zats-example" ] ; then
echo "zats-example path is not found!!"
fi
if [ ! -d "./zats-mimic" ] ; then
echo "zats-mimic path is not found!!"
fi
if [ ! -d "./zats-mimic-ext6" ] ; then
echo "zats-mimic-ext6 path is not found!!"
fi
if [ ! -d "./zats-mimic-ext7" ] ; then
echo "zats-mimic-ext7 path is not found!!"
fi
if [ ! -d "./zats-mimic-ext96" ] ; then
echo "zats-mimic-ext96 path is not found!!"
fi
Zats=$maindir
fi
if [ "$oldVersion" == "" ] || [ "$newVersion" == "" ] ; then
echo "Usage: upVer [ oldVersion ] [ newVersion ] [options]"
echo "Available options: FL."
exit 1
fi
function upVer {
if [ "$isFL" == "FL" ] ; then
sed -i "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion-SNAPSHOT<\//" $1/pom.xml
echo "$1 pom.xml"
grep -n --color=auto $newVersion"-SNAPSHOT" $1/pom.xml
else
sed -i "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion<\//" $1/pom.xml
echo "$1 pom.xml"
grep -n --color=auto $newVersion $1/pom.xml
fi
# sed -i "s/$oldVersion.*/$newVersion/g" $1/version
# echo "$1 version"
# grep -n --color=auto $newVersion $1/version
# echo "$1 MANIFEST.MF"
# find $1/src -name MANIFEST.MF -exec sed -i "s/$oldVersion.*/$newVersion/g
# " {} \; -exec grep -n --color=auto $newVersion {} \;
# 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 lang.xml"
# find $1/src -name lang.xml -exec sed -i "
# /<version/,/\/version>/s/>$oldVersion.*<\//>$newVersion<\//g
# " {} \; -exec grep -n --color=auto $newVersion {} \;
# echo "$1 lang-addon.xml"
# find $1/src -name lang-addon.xml -exec sed -i "
# /<version/,/\/version>/s/>$oldVersion.*<\//>$newVersion<\//g
# " {} \; -exec grep -n --color=auto $newVersion {} \;
# echo "$1 lang-addon.xml javascript"
# find $1/src -name lang-addon.xml -exec sed -i "
# s/version=\"$oldVersion.*\"/version=\"$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 zats
upVer zats-common
upVer zats-example
upVer zats-mimic
upVer zats-mimic-ext6
upVer zats-mimic-ext7
upVer zats-mimic-ext96
upVer zats-example