Browse Source

Fix sed on linux

pull/4268/head
Matt Keeler 7 years ago
parent
commit
9862175481
  1. 4
      build-support/functions/00-vars.sh
  2. 6
      build-support/functions/10-util.sh

4
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
CONSUL_BINARY_TYPE=oss

6
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 $?
}

Loading…
Cancel
Save