This repository was archived by the owner on Jan 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 22
33set -eo pipefail
44
5- SELF_ROOT=$( cd $( dirname " $0 " ) && pwd)
5+ if [ $# -ne 1 ]; then
6+ echo " $0 | A script to release new versions automatically"
7+ echo " Usage: $0 VERSION_CODE"
8+ exit -1
9+ fi
610
711function call_sed(){
812PATTERN=" $1 "
1822
1923FILE_BUILD_GRADLE=" $SELF_ROOT /algoliasearch/common.gradle"
2024FILE_API_CLIENT=" $SELF_ROOT /algoliasearch/src/main/java/com/algolia/search/saas/Client.java"
25+ SELF_ROOT=$( cd $( dirname " $0 " ) && pwd)
26+ VERSION_CODE=$1
2127
22- if [ $# -ne 1 ]; then
23- echo " $0 | A script to release new versions automatically"
24- echo " Usage: $0 VERSION_CODE"
28+ set +eo pipefail
29+ COUNT_DOTS=$( grep -o " \." <<< $VERSION_CODE | wc -l)
30+ set -eo pipefail
31+
32+ if [ $COUNT_DOTS -ne 2 ]; then
33+ echo " $VERSION_CODE is not a valid version code, please use the form X.Y.Z (e.g. v1 = 1.0.0)"
2534 exit -1
2635fi
2736
28- VERSION_CODE=$1
29-
3037# Check that the working repository is clean (without any changes, neither staged nor unstaged).
3138# An exception is the change log, which should have been edited, but not necessarily committed (we usually commit it
3239# along with the version number).
You can’t perform that action at this time.
0 commit comments