File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,29 @@ cd "$root"
7
7
sub=' { s/^.*["' " '" ' ]\([0-9]*\.[0-9]*\.[0-9]*\)["' " '" ' ].*$/\1/;p; }'
8
8
old1=$( sed -n -e ' /version *=/' " $sub " ' ' python/setup.py)
9
9
old2=$( sed -n -e ' /"version" *:/' " $sub " ' ' nodejs/package.json)
10
-
11
- if [ " $old1 " != " $old2 " ]; then
10
+ if [[ " $old1 " != " $old2 " ]]; then
12
11
echo " Versions aren't the same: $old1 != $old2 " 1>&2
13
12
exit 1
14
13
fi
15
- IFS=. v=($old1 )
16
- new=" ${v[0]} .${v[1]} .$(( ${v[2]} + 1 )) "
17
14
18
- sub=' s/\(["' " '" ' ]\)' " $old1 " ' ["' " '" ' ]/\1' " $new " ' \1/'
19
- sed -i~ -e ' /version *=/' " $sub " python/setup.py
20
- sed -i~ -e ' /"version" *:/' " $sub " nodejs/package.json
15
+ case " $1 " in
16
+ +)
17
+ IFS=. v=($old1 )
18
+ new=" ${v[0]} .${v[1]} .$(( ${v[2]} + 1 )) "
19
+
20
+ sub=' s/\(["' " '" ' ]\)' " $old1 " ' ["' " '" ' ]/\1' " $new " ' \1/'
21
+ sed -i~ -e ' /version *=/' " $sub " python/setup.py
22
+ sed -i~ -e ' /"version" *:/' " $sub " nodejs/package.json
23
+ ;;
24
+
25
+ =)
26
+ new=" $old1 "
27
+ ;;
28
+ * )
29
+ echo " Publish current version: $0 =" 1>&2
30
+ echo " Increment version and publish: $0 +" 1>&2
31
+ exit 2
32
+ esac
21
33
22
34
pushd " $root " /python
23
35
python setup.py sdist
@@ -28,6 +40,8 @@ pushd "$root"/nodejs
28
40
npm publish
29
41
popd
30
42
31
- git commit -m " Update version to $new " python/setup.py nodejs/package.json
43
+ if [[ " $1 " == " +" ]]; then
44
+ git commit -m " Update version to $new " python/setup.py nodejs/package.json
45
+ fi
32
46
git tag -a v" $new " -m " Release version $new "
33
47
git push origin v" $new "
You can’t perform that action at this time.
0 commit comments