From 53a60aedd3932e7d2986434ab6e2c9cf1ef7d50d Mon Sep 17 00:00:00 2001 From: Julian Villella Date: Tue, 2 May 2017 00:20:03 -0500 Subject: Replace sed_hyphen_i() with portable implementation (#8935) --- configure | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 8124888f6a..1844799225 100755 --- a/configure +++ b/configure @@ -35,12 +35,9 @@ function is_windows() { fi } -function sed_hyphen_i() { - if is_macos; then - sed -i '' "$@" - else - sed -i "$@" - fi +function sed_in_place() { + sed -e $1 $2 > "$2.bak" + mv "$2.bak" $2 } function write_to_bazelrc() { @@ -170,7 +167,7 @@ function setup_python { rm -f .tf_configure.bazelrc touch .tf_configure.bazelrc touch .bazelrc -sed_hyphen_i "/tf_configure/d" .bazelrc +sed_in_place "/tf_configure/d" .bazelrc echo "import %workspace%/.tf_configure.bazelrc" >> .bazelrc # Delete any leftover BUILD files from the Makefile build, which would interfere -- cgit v1.2.3