-
Notifications
You must be signed in to change notification settings - Fork 19
/
upVer
executable file
·78 lines (68 loc) · 2.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
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
#!/bin/bash
# upVer
#
#{{IS_NOTE
# Purpose:
#
# Description:
#
# History:
# Fri Oct 23 11:11:09 2015, Created by Christopher
#}}IS_NOTE
#
#Copyright (C) 2015 Potix Corporation. All Rights Reserved.
#
#{{IS_RIGHT
#}}IS_RIGHT
#
if [ ! -d "ckez" ] ; then
echo "cannot locate ckez/ folder"
exit 1
fi
maindir="$(pwd)"
cd $maindir
echo "Working directory $maindir"
stamp=$(date +%Y%m%d)
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
sed --in-place='' "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion-SNAPSHOT<\//" $1/pom.xml
echo "$1 pom.xml"
grep -n --color=auto $newVersion"-SNAPSHOT" $1/pom.xml
echo "ckeztest/pom.xml"
find test/addon/ckeztest -name pom.xml -exec sed --in-place='' "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion-SNAPSHOT<\//" {} \;
grep -n --color=auto $newVersion"-SNAPSHOT" test/addon/ckeztest/pom.xml
else
sed --in-place='' "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion<\//" $1/pom.xml
echo "$1 pom.xml"
grep -n --color=auto $newVersion $1/pom.xml
echo "ckeztest/pom.xml"
find test/addon/ckeztest -name pom.xml -exec sed --in-place='' "/version>/,/<\//s/>$oldVersion.*<\//>$newVersion<\//" {} \;
grep -n --color=auto $newVersion test/addon/ckeztest/pom.xml
fi
echo "$1 config.xml"
find $1/src -name config.xml -exec sed --in-place='' "
/<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 --in-place='' "
/<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 --in-place='' "
s/version=\"$oldVersion.*\"/version=\"$newVersion\"/g
" {} \; -exec grep -n --color=auto $newVersion {} \;
echo "$1 Version.java"
find $1/src -name Version.java -exec sed --in-place='' "
s/UID = \"$oldVersion.*\";/UID = \"$newVersion\";/g
" {} \; -exec grep -n --color=auto $newVersion {} \;
}
upVer ckez
cd $maindir