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"
77sub=' { s/^.*["' " '" ' ]\([0-9]*\.[0-9]*\.[0-9]*\)["' " '" ' ].*$/\1/;p; }'
88old1=$( sed -n -e ' /version *=/' " $sub " ' ' python/setup.py)
99old2=$( sed -n -e ' /"version" *:/' " $sub " ' ' nodejs/package.json)
10-
11- if [ " $old1 " != " $old2 " ]; then
10+ if [[ " $old1 " != " $old2 " ]]; then
1211 echo " Versions aren't the same: $old1 != $old2 " 1>&2
1312 exit 1
1413fi
15- IFS=. v=($old1 )
16- new=" ${v[0]} .${v[1]} .$(( ${v[2]} + 1 )) "
1714
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
2133
2234pushd " $root " /python
2335python setup.py sdist
@@ -28,6 +40,8 @@ pushd "$root"/nodejs
2840npm publish
2941popd
3042
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
3246git tag -a v" $new " -m " Release version $new "
3347git push origin v" $new "
You can’t perform that action at this time.
0 commit comments