Don't hardcode /bin/bash

Some platforms either don't have bash installed as /bin/bash. Use
the environment to find it in the PATH.

Change-Id: Ie1a6d64146927c83af07d0e2ca7f573c7504f8ef
This commit is contained in:
Dan McGregor 2016-11-29 07:41:27 -06:00
parent 2b822834e2
commit feaee26c2d
6 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
wct_bin=$(which wct)
if [[ -z "$wct_bin" ]]; then

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -105,7 +105,7 @@ def _bower_archive(ctx):
]), False)
def _bash(ctx, cmd):
cmd_list = ["/bin/bash", "-c", cmd]
cmd_list = ["bash", "-c", cmd]
out = ctx.execute(cmd_list)
if out.return_code:
fail("failed %s: %s" % (" ".join(cmd_list), out.stderr))

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash
# Copyright (C) 2015 The Android Open Source Project
#
@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
if [[ "$#" != "1" ]] ; then
cat <<EOF
Usage: run "$0 COMMAND" from the top of your workspace,

View File

@ -13,8 +13,9 @@
# limitations under the License.
sh_bang_template = (" && ".join([
"echo '#!/bin/bash -e' > $@",
"echo '#!/usr/bin/env bash' > $@",
"echo \"# this script should run from the root of your workspace.\" >> $@",
"echo \"set -e\" >> $@",
"echo \"\" >> $@",
"echo 'if [[ \"$$VERBOSE\" ]]; then set -x ; fi' >> $@",
"echo \"\" >> $@",

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# This script will be run by bazel when the build process starts to
# generate key-value information that represents the status of the