diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 517d078032..a26279b892 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -32,10 +32,8 @@ 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" + SED_EXT="-r" fi CONSUL_BINARY_TYPE=oss diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index f3cc2909e5..1de0b949fb 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -58,6 +58,17 @@ function debug { fi } +function sed_i { + if test "$(uname)" == "Darwin" + then + sed -i '' "$@" + return $? + else + sed -i "$@" + return $? + fi +} + function is_set { # Arguments: # $1 - string value to check its truthiness