blob: 1c3d95a24e8ae8d47bd95723f5499eae2d3f0f40 [file] [log] [blame]
Boyuan Yan6b23b382019-06-04 11:59:35 -07001#!/bin/bash
2set -euo pipefail
3# --- begin runfiles.bash initialization ---
4if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
5 if [[ -f "$0.runfiles_manifest" ]]; then
6 export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
7 elif [[ -f "$0.runfiles/MANIFEST" ]]; then
8 export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST"
9 elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
10 export RUNFILES_DIR="$0.runfiles"
11 fi
12fi
13
14if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
15 source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash"
16elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
17 source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \
18 "$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)"
19else
20 echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash"
21 exit 1
22fi
23
24# --- end runfiles.bash initialization ---
25
26