Skip to content

Commit e21209f

Browse files
author
Michael Wilkerson-Barker
authored
Update 'release-init.sh' script to update git submodules prior to starting the release process (#7517)
* Update submodules and added help text for release-init script * updated some comments
1 parent 32e931a commit e21209f

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tools/release-init.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,33 @@
55
# Description of release procedure can be found at https://github.com/realm/realm-wiki/wiki/Releasing-Realm-Core
66
#
77

8-
realm_version=$(echo "$1" | egrep '^[0-9]?[0-9].[0-9]+.[0-9]+(-.*)?$')
8+
VERSION_GREP='^[0-9]?[0-9].[0-9]+.[0-9]+(-.*)?$'
9+
10+
function usage()
11+
{
12+
echo "Usage: release-init.sh VERSION"
13+
echo " VERSION format regex: ${VERSION_GREP}"
14+
echo " Examples:"
15+
echo " 10.123.1"
16+
echo " 99.999999.999999"
17+
echo " 4.5.0-CustDemo"
18+
exit 1
19+
}
20+
21+
if [[ -z "$1" ]]; then
22+
usage
23+
fi
24+
25+
# egrep has been replaced with 'grep -E'
26+
realm_version=$(echo "$1" | grep -E "${VERSION_GREP}")
927
if [ -z "${realm_version}" ]; then
1028
echo Wrong version format: "$1"
11-
exit 1
29+
usage
1230
fi
1331

32+
# make sure submodules are up to date
33+
git submodule update --init --recursive
34+
1435
project_dir=$(git rev-parse --show-toplevel)
1536

1637
git branch release/${realm_version}

0 commit comments

Comments
 (0)