From 98621754812f083623dd22c3e95f63a2edb2594d Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Fri, 22 Jun 2018 17:21:42 -0400 Subject: [PATCH] Fix sed on linux --- build-support/functions/00-vars.sh | 4 +++- build-support/functions/10-util.sh | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 7fe4a7d80c..517d078032 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -32,8 +32,10 @@ CONSUL_PKG_NAME="consul" if test "$(uname)" == "Darwin" then SED_EXT="-E" + alias sed_i="sed -i ''" else SED_EXT="" + alias sed_i="sed -i" fi -CONSUL_BINARY_TYPE=oss \ No newline at end of file +CONSUL_BINARY_TYPE=oss diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index 2e89cbd155..f3cc2909e5 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -623,7 +623,7 @@ function update_version { local version="$2" local prerelease="$3" - sed ${SED_EXT} -i "" -e "s/(Version[[:space:]]*=[[:space:]]*)\"[^\"]*\"/\1\"${version}\"/g" -e "s/(VersionPrerelease[[:space:]]*=[[:space:]]*)\"[^\"]*\"/\1\"${prerelease}\"/g" "${vfile}" + sed_i ${SED_EXT} -e "s/(Version[[:space:]]*=[[:space:]]*)\"[^\"]*\"/\1\"${version}\"/g" -e "s/(VersionPrerelease[[:space:]]*=[[:space:]]*)\"[^\"]*\"/\1\"${prerelease}\"/g" "${vfile}" return $? } @@ -658,7 +658,7 @@ function set_changelog_version { rel_date=$(date +"%B %d, %Y") fi - sed ${SED_EXT} -i "" -e "s/## UNRELEASED/## ${version} (${rel_date})/" "${changelog}" + sed_i ${SED_EXT} -e "s/## UNRELEASED/## ${version} (${rel_date})/" "${changelog}" return $? } @@ -678,7 +678,7 @@ function unset_changelog_version { return 1 fi - sed ${SED_EXT} -i "" -e "1 s/^## [0-9]+\.[0-9]+\.[0-9]+ \([^)]*\)/## UNRELEASED/" "${changelog}" + sed_i ${SED_EXT} -e "1 s/^## [0-9]+\.[0-9]+\.[0-9]+ \([^)]*\)/## UNRELEASED/" "${changelog}" return $? }