File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 22#
33
44mkl_require good_cflags
5- mkl_require gitversion as KAFKACAT_VERSION
5+ mkl_require gitversion as KAFKACAT_VERSION default 1.3.1
66
77
88function checks {
Original file line number Diff line number Diff line change 66# VARIABLE_NAME
77#
88# Example: Set version in variable named "MYVERSION":
9- # mkl_require gitversion as MYVERSION
9+ # mkl_require gitversion as MYVERSION [default DEFVERSION]
1010
1111if [[ $1 == " as" ]]; then
12- __MKL_GITVERSION_VARNAME=" $2 "
12+ shift
13+ __MKL_GITVERSION_VARNAME=" $1 "
14+ shift
1315else
1416 __MKL_GITVERSION_VARNAME=" VERSION"
1517fi
1618
19+ if [[ $1 == " default" ]]; then
20+ shift
21+ __MKL_GITVERSION_DEFAULT=" $1 "
22+ shift
23+ fi
24+
25+
1726function checks {
18- mkl_allvar_set " gitversion" " $__MKL_GITVERSION_VARNAME " " $( git describe --abbrev=6 --tags HEAD --always) "
27+ mkl_allvar_set " gitversion" " $__MKL_GITVERSION_VARNAME " \
28+ " $( git describe --abbrev=6 --tags HEAD --always 2> /dev/null || echo $__MKL_GITVERSION_DEFAULT ) "
1929}
You can’t perform that action at this time.
0 commit comments