diff --git a/tools/bazel b/tools/bazel index 4e99266e6..955ce4a7a 100755 --- a/tools/bazel +++ b/tools/bazel @@ -15,6 +15,7 @@ fi # genrule() invocations like //:buildinfo, as they call 'bazel run python', which # fails as BAZEL_REAL is not passed to the child process. Work around it by removing # the tools folder from the path. -export PATH=$(echo "$PATH" | sed 's@^.*/tools:@@') +toolsPath=$(dirname $0) +export PATH=$(echo "$PATH" | sed "s@${toolsPath}:@@") exec $BAZEL_REAL $extra_args "$@"