@@ -63,14 +63,18 @@ git change release
6363git sync
6464
6565# Create commit for actual release.
66- sed -i " " -e " s/\(Minor *= *\)[0-9]*/\1$VERSION_MINOR /" internal/version/version.go
67- sed -i " " -e " s/\(Patch *= *\)[0-9]*/\1$VERSION_PATCH /" internal/version/version.go
68- sed -i " " -e " s/\(PreRelease *= *\)\" [^\" ]*\" /\1\" $VERSION_PRERELEASE \" /" internal/version/version.go
66+ INPLACE=' -i ""' # BSD version of sed expects argument after -i
67+ if [[ " $( sed --version) " == * " GNU" * ]]; then
68+ INPLACE=" -i" # GNU version of sed does not expect argument after -i
69+ fi
70+ sed $INPLACE -e " s/\(Minor *= *\)[0-9]*/\1$VERSION_MINOR /" internal/version/version.go
71+ sed $INPLACE -e " s/\(Patch *= *\)[0-9]*/\1$VERSION_PATCH /" internal/version/version.go
72+ sed $INPLACE -e " s/\(PreRelease *= *\)\" [^\" ]*\" /\1\" $VERSION_PRERELEASE \" /" internal/version/version.go
6973if ! [[ -z $GEN_VERSION ]]; then
70- sed -i " " -e " s/\(GenVersion *= *\)[0-9]*/\1$GEN_VERSION /" runtime/protoimpl/version.go
74+ sed $INPLACE -e " s/\(GenVersion *= *\)[0-9]*/\1$GEN_VERSION /" runtime/protoimpl/version.go
7175fi
7276if ! [[ -z $MIN_VERSION ]]; then
73- sed -i " " -e " s/\(MinVersion *= *\)[0-9]*/\1$MIN_VERSION /" runtime/protoimpl/version.go
77+ sed $INPLACE -e " s/\(MinVersion *= *\)[0-9]*/\1$MIN_VERSION /" runtime/protoimpl/version.go
7478fi
7579git commit -a -m " all: release $( version_string) "
7680
@@ -80,7 +84,7 @@ go test -mod=vendor -timeout=60m -count=1 integration_test.go "$@" -buildRelease
8084# Create commit to start development after release.
8185VERSION_PRERELEASE=" ${VERSION_PRERELEASE} .devel" # append ".devel"
8286VERSION_PRERELEASE=" ${VERSION_PRERELEASE# " ." } " # trim possible leading "."
83- sed -i " " -e " s/\(PreRelease *= *\)\" [^\" ]*\" /\1\" $VERSION_PRERELEASE \" /" internal/version/version.go
87+ sed $INPLACE -e " s/\(PreRelease *= *\)\" [^\" ]*\" /\1\" $VERSION_PRERELEASE \" /" internal/version/version.go
8488git commit -a -m " all: start $( version_string) "
8589
8690echo
0 commit comments