#!/usr/bin/env bash

set -euo pipefail

script_directory="$(dirname "${BASH_SOURCE[0]}")"

base_dir="${script_directory}/../.."

if ! [[ -x "$base_dir"/ci/runners/valgrind.sh ]]; then
  base_dir="$script_directory"/valgrind_ros.runfiles/zoox
  if ! [[ -x "$base_dir"/ci/runners/valgrind.sh ]]; then
    echo Failed to find valgrind runfiles!
    exit 1
  fi
fi

ROSBAZEL_RUNUNDER="$base_dir/ci/runners/valgrind.sh" "$@"
