From 657eda99cd93967aea83adc129c63d45919c9593 Mon Sep 17 00:00:00 2001 From: hamphet Date: Sun, 18 Aug 2024 15:56:54 -0700 Subject: [PATCH] Modify toolchain/autoupdate_testdata.py to use scripts/scripts_utils.py --- scripts/__init__.py | 0 toolchain/autoupdate_testdata.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 scripts/__init__.py 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,