Dan McGregor | feaee26 | 2016-11-29 07:41:27 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 2 | # Copyright (C) 2015 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Edwin Kempin | 7c6d5cd | 2021-08-09 10:22:41 +0200 | [diff] [blame] | 16 | bazel_bin=$(which bazelisk 2>/dev/null) |
| 17 | if [[ -z "$bazel_bin" ]]; then |
| 18 | echo "Warning: bazelisk is not installed; falling back to bazel." |
| 19 | bazel_bin=bazel |
| 20 | fi |
| 21 | |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 22 | set -eu |
Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 23 | SCRIPTNAME=$(mktemp) |
| 24 | trap "{ rm -f $SCRIPTNAME; }" EXIT |
Edwin Kempin | 7c6d5cd | 2021-08-09 10:22:41 +0200 | [diff] [blame] | 25 | ${bazel_bin} run --script_path="$SCRIPTNAME" //polygerrit-ui:devserver |
Logan Hanks | 784849c | 2018-09-12 14:35:10 -0700 | [diff] [blame] | 26 | "$SCRIPTNAME" "$@" |