cipd/python: optimize cat usage

Bash has a builtin for reading files, so use that instead of running
the cat program to save on time & overhead.

Change-Id: Ia90fc22a47f2ead4ef056020a79ebdebd7bd70ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4111082
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Mike Frysinger
2023-01-23 15:31:10 +00:00
committed by LUCI CQ
parent e852391441
commit 67702834cc
3 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ then
# this converts them to the forward slashes a unix environment expects.
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python_bin_reldir.txt)"
else
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python_bin_reldir.txt)"
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(<"$DEPOT_TOOLS/python_bin_reldir.txt")"
fi
PATH="$PYTHON_BIN_DIR":"$PATH"
"$PYTHON_BIN_DIR/python" "$@"