Update release script for GNU sed compatibility

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2016-01-28 17:23:11 -08:00
parent 5ab6f319e9
commit bf542964c9
1 changed files with 6 additions and 1 deletions

View File

@ -116,8 +116,13 @@ checkError "Can't clone into ${RELEASE_DIR}, aborting"
cd "${RELEASE_DIR}"
display "Bump version number to ${VERSION}"
sed -i "" "s/Version = \".*-dev\"/Version = \"${VERSION}\"/g" version/version.go
# Why 'sed' and then 'mv' instead of 'sed -i'? BSD / GNU sed compatibility.
# Macs have BSD sed by default, Linux has GNU sed. See
# http://unix.stackexchange.com/questions/92895/how-to-achieve-portability-with-sed-i-in-place-editing
sed -e "s/Version = \".*-dev\"/Version = \"${VERSION}\"/g" version/version.go >version/version.go.new
checkError "Unable to change version in version/version.go"
mv -- version/version.go.new version/version.go
git add version/version.go
git commit -q -m"Bump version to ${VERSION}" -s