aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar Julian Villella <julian.villella@hotmail.com>2017-05-02 00:20:03 -0500
committerGravatar Martin Wicke <martin.wicke@gmail.com>2017-05-01 22:20:03 -0700
commit53a60aedd3932e7d2986434ab6e2c9cf1ef7d50d (patch)
tree5059cf47ea7f9dfc393f77c035ab88f7a6f7fec8 /configure
parente184562ea5234e84592ee78f964522ffe1c2cbd6 (diff)
Replace sed_hyphen_i() with portable implementation (#8935)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 4 insertions, 7 deletions
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