diff options
author | Dmitry Lomov <dslomov@google.com> | 2018-01-15 06:26:32 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-15 06:28:08 -0800 |
commit | 9582cff36e2a51e6d17869d77d175a2c465710c3 (patch) | |
tree | 35b72123a9774f59b0d0394dc143ebab97ae6a69 /tools | |
parent | 5bfa5844d0d16d71e88002956e88402bfec88ef7 (diff) |
Use BAZEL_SH if available instead of hard-coding bash in git.bzl
Fixes #3699.
Change-Id: I44028476be96037334a1ae48de450d625925676f
PiperOrigin-RevId: 181962926
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build_defs/repo/git.bzl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/build_defs/repo/git.bzl b/tools/build_defs/repo/git.bzl index 87bae53f1b..0d32fafa45 100644 --- a/tools/build_defs/repo/git.bzl +++ b/tools/build_defs/repo/git.bzl @@ -28,7 +28,8 @@ def _clone_or_update(ctx): if ctx.attr.strip_prefix: directory = directory + "-tmp" - st = ctx.execute(['bash', '-c', """ + bash_exe = ctx.os.environ["BAZEL_SH"] if "BAZEL_SH" in ctx.os.environ else "bash" + st = ctx.execute([bash_exe, '-c', """ set -ex ( cd {working_dir} && if ! ( cd '{dir_link}' && [[ "$(git rev-parse --git-dir)" == '.git' ]] ) >/dev/null 2>&1; then @@ -56,7 +57,7 @@ set -ex ctx.symlink(dest_link, ctx.path('.')) if ctx.attr.init_submodules: - st = ctx.execute(['bash', '-c', """ + st = ctx.execute([bash_exe, '-c', """ set -ex ( cd '{directory}' git submodule update --init --checkout --force ) |