-
Notifications
You must be signed in to change notification settings - Fork 1
/
.release
73 lines (64 loc) · 1.65 KB
/
.release
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
getMobileVersion() {
awk -F= '/^mobile=/{print $2}' .version
}
nextMobilePatchVersion() {
version=${1:-$(getMobileVersion)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
nextMobileMinorVersion() {
version=${1:-$(getMobileVersion)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
nextMobileMajorVersion() {
version=${1:-$(getMobileVersion)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
setMobileVersion() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^mobile=.*/mobile=$1/g" .version
rm -f .version.x
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
getCliVersion() {
awk -F= '/^cli=/{print $2}' .version
}
nextCliPatchVersion() {
version=${1:-$(getCliVersion)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
nextCliMinorVersion() {
version=${1:-$(getCliVersion)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
nextCliMajorVersion() {
version=${1:-$(getCliVersion)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
setCliVersion() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^cli=.*/cli=$1/g" .version
rm -f .version.x
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}