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
diff --git a/polygerrit-ui/app/run_test.sh b/polygerrit-ui/app/run_test.sh
index 95d30e5..d17a530 100755
--- a/polygerrit-ui/app/run_test.sh
+++ b/polygerrit-ui/app/run_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 wct_bin=$(which wct)
 if [[ -z "$wct_bin" ]]; then
diff --git a/polygerrit-ui/run-server.sh b/polygerrit-ui/run-server.sh
index 603d34a..cbe3563 100755
--- a/polygerrit-ui/run-server.sh
+++ b/polygerrit-ui/run-server.sh
@@ -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");
diff --git a/tools/bzl/js.bzl b/tools/bzl/js.bzl
index 7acf382..788301c 100644
--- a/tools/bzl/js.bzl
+++ b/tools/bzl/js.bzl
@@ -105,7 +105,7 @@
     ]), 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))
diff --git a/tools/maven/api.sh b/tools/maven/api.sh
index 92fc0dd..8c441fb 100755
--- a/tools/maven/api.sh
+++ b/tools/maven/api.sh
@@ -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,
diff --git a/tools/maven/package.bzl b/tools/maven/package.bzl
index cf36311..3c32bb2 100644
--- a/tools/maven/package.bzl
+++ b/tools/maven/package.bzl
@@ -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 \"\" >> $@",
diff --git a/tools/workspace-status.sh b/tools/workspace-status.sh
index 1ef91b8..4c8b7f6 100755
--- a/tools/workspace-status.sh
+++ b/tools/workspace-status.sh
@@ -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