diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/toolchain/autoupdate_testdata.py b/toolchain/autoupdate_testdata.py index 4bd3b558b258b..23a0f166a2573 100755 --- a/toolchain/autoupdate_testdata.py +++ b/toolchain/autoupdate_testdata.py @@ -11,16 +11,23 @@ import re import subprocess import sys +import os from pathlib import Path +directory = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) +sys.path.append(os.path.join(directory)) +import scripts.scripts_utils # noqa: E402 + def main() -> None: + scripts.scripts_utils.chdir_repo_root() + bazel = scripts.scripts_utils.locate_bazel() # Use the most recently used build mode, or `fastbuild` if missing # `bazel-bin`. build_mode = "fastbuild" workspace = subprocess.check_output( [ - "bazel", + bazel, "info", "workspace", "--ui_event_filters=stdout", @@ -37,7 +44,7 @@ def main() -> None: exit(f"Build mode not found in `bazel-bin` symlink: {link}") argv = [ - "bazel", + bazel, "run", "-c", build_mode,