File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Bump patch version in package.json & examples/parent-child-demo/package.json, commit as "Release X.Y.Z",
4+ # and add git tag "vX.Y.Z" with message "Release X.Y.Z".
5+
6+ set -o nounset -o errexit -o pipefail
7+ gitStatus=$( git status -s)
8+ if [[ -n $gitStatus ]]; then
9+ echo " ERROR: Working tree has modified/untracked files:"
10+ echo " ${gitStatus} "
11+ exit 1
12+ fi
13+
14+ if [[ ` cat package.json` =~ .* \" version\" :\ * \" ([0-9]+)\. ([0-9]+)\. ([0-9]+)\" ]]
15+ then
16+ vMajor=${BASH_REMATCH[1]}
17+ vMinor=${BASH_REMATCH[2]}
18+ vPatch=${BASH_REMATCH[3]}
19+ newVersion=$vMajor .$vMinor .$(( $vPatch + 1 ))
20+ echo " Bumped version from ${vMajor} .${vMinor} .${vPatch} to ${newVersion} "
21+ sed -i ' ' -e " s/\(\" version\" : *\" \).*\(\" .*\)$/\1${newVersion} \2/" package.json
22+ sed -i ' ' -e " s/\(\" react-lifecycle-visualizer\" : *\" [\^~]\{0,1\}\).*\(\" .*\)$/\1${newVersion} \2/" examples/parent-child-demo/package.json
23+ git add package.json examples/parent-child-demo/package.json
24+ git commit -m " Release ${newVersion} "
25+ git tag -a " v${newVersion} " -m " Release ${newVersion} "
26+ else
27+ echo " ERROR: No \" version\" found in package.json"
28+ exit 1
29+ fi
You can’t perform that action at this time.
0 commit comments