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 2
2
3
3
set -eo pipefail
4
4
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
6
10
7
11
function call_sed(){
8
12
PATTERN=" $1 "
18
22
19
23
FILE_BUILD_GRADLE=" $SELF_ROOT /algoliasearch/common.gradle"
20
24
FILE_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
21
27
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)"
25
34
exit -1
26
35
fi
27
36
28
- VERSION_CODE=$1
29
-
30
37
# Check that the working repository is clean (without any changes, neither staged nor unstaged).
31
38
# An exception is the change log, which should have been edited, but not necessarily committed (we usually commit it
32
39
# along with the version number).
You can’t perform that action at this time.
0 commit comments