From bb109cd7c3946a8982aa75d8d96e93191c09690b Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Thu, 17 Aug 2023 22:31:06 +0000 Subject: [PATCH] Add reclient_metrics command This adds reclient_metrics and reclient_metrics.bat to make it easier to run reclient_metrics.py. In particular this lets the script be run without caring about its location and without (on Windows) having to prefix the script with "python3". This slightly simplifies the reclient instructions. Bug: None Change-Id: Ied58f452edb13cf257873ddee043817a765eee3c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4764130 Auto-Submit: Bruce Dawson Reviewed-by: Ben Segall Commit-Queue: Scott Lee Reviewed-by: Scott Lee --- reclient_metrics | 8 ++++++++ reclient_metrics.bat | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 reclient_metrics create mode 100755 reclient_metrics.bat diff --git a/reclient_metrics b/reclient_metrics new file mode 100755 index 000000000..830b81c1c --- /dev/null +++ b/reclient_metrics @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +base_dir=$(dirname "$0") +PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/reclient_metrics.py" "$@" diff --git a/reclient_metrics.bat b/reclient_metrics.bat new file mode 100755 index 000000000..7e69abf8b --- /dev/null +++ b/reclient_metrics.bat @@ -0,0 +1,12 @@ +@echo off +:: Copyright 2023 The Chromium Authors +:: Use of this source code is governed by a BSD-style license that can be +:: found in the LICENSE file. +setlocal + +:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used +:: standalone, but allow other PATH manipulations to take priority. +set PATH=%PATH%;%~dp0 + +:: Defer control. +python3 "%~dp0\reclient_metrics.py" "%*"