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:
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
wct_bin=$(which wct)
|
wct_bin=$(which wct)
|
||||||
if [[ -z "$wct_bin" ]]; then
|
if [[ -z "$wct_bin" ]]; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
# Copyright (C) 2015 The Android Open Source Project
|
# Copyright (C) 2015 The Android Open Source Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ def _bower_archive(ctx):
|
|||||||
]), False)
|
]), False)
|
||||||
|
|
||||||
def _bash(ctx, cmd):
|
def _bash(ctx, cmd):
|
||||||
cmd_list = ["/bin/bash", "-c", cmd]
|
cmd_list = ["bash", "-c", cmd]
|
||||||
out = ctx.execute(cmd_list)
|
out = ctx.execute(cmd_list)
|
||||||
if out.return_code:
|
if out.return_code:
|
||||||
fail("failed %s: %s" % (" ".join(cmd_list), out.stderr))
|
fail("failed %s: %s" % (" ".join(cmd_list), out.stderr))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash -e
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (C) 2015 The Android Open Source Project
|
# Copyright (C) 2015 The Android Open Source Project
|
||||||
#
|
#
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
if [[ "$#" != "1" ]] ; then
|
if [[ "$#" != "1" ]] ; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: run "$0 COMMAND" from the top of your workspace,
|
Usage: run "$0 COMMAND" from the top of your workspace,
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
sh_bang_template = (" && ".join([
|
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 \"# this script should run from the root of your workspace.\" >> $@",
|
||||||
|
"echo \"set -e\" >> $@",
|
||||||
"echo \"\" >> $@",
|
"echo \"\" >> $@",
|
||||||
"echo 'if [[ \"$$VERBOSE\" ]]; then set -x ; fi' >> $@",
|
"echo 'if [[ \"$$VERBOSE\" ]]; then set -x ; fi' >> $@",
|
||||||
"echo \"\" >> $@",
|
"echo \"\" >> $@",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# This script will be run by bazel when the build process starts to
|
# This script will be run by bazel when the build process starts to
|
||||||
# generate key-value information that represents the status of the
|
# generate key-value information that represents the status of the
|
||||||
|
|||||||
Reference in New Issue
Block a user