aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2017-05-17 18:06:54 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2017-05-17 18:06:54 -0700
commit64d283057b91f21ea98ac13af74435c9d9edb6ee (patch)
tree31859eec72559d268cc9b8e2a9d3fa2fe8fc3a44 /configure
parente5824d60f717e4aea40e11944873c1eb56cb994b (diff)
Make .bazelrc import ~/.bazelrc (#9987)
When running ./configure for the first time, an import ~/.bazelrc statement will be added to the generated .bazelrc if the user has one. Fixes #9963 See also bazelbuild/bazel#3022
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure b/configure
index 308369efd3..d751563b58 100755
--- a/configure
+++ b/configure
@@ -166,7 +166,13 @@ function setup_python {
# This file contains customized config settings.
rm -f .tf_configure.bazelrc
touch .tf_configure.bazelrc
-touch .bazelrc
+if [[ ! -e .bazelrc ]]; then
+ if [[ -e "${HOME}/.bazelrc" ]]; then
+ echo "import ${HOME}/.bazelrc" >.bazelrc
+ else
+ touch .bazelrc
+ fi
+fi
sed_in_place "/tf_configure/d" .bazelrc
echo "import %workspace%/.tf_configure.bazelrc" >> .bazelrc