mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
setup & share path to depot_tools checkout
A lot of scripts like to compute the dirname of $0 to find itself to load more files. Have some scripts export & resuse this value so we avoid recalculating when not needed. Bug: 1469696 Change-Id: I3aac2e6119dbfa3c68715208df2786f67cdce92e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4750430 Auto-Submit: Mike Frysinger <vapier@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -11,6 +11,9 @@ then
|
||||
exit
|
||||
fi
|
||||
|
||||
# Export for other depot_tools scripts to re-use.
|
||||
export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "$0")}"
|
||||
|
||||
# Test if this script is running under a MSYS install. This is likely an error
|
||||
# if it is, so we warn the user accordingly.
|
||||
OUTPUT="$(uname | grep 'MSYS')"
|
||||
@@ -25,7 +28,7 @@ if [ $MSYS = 0 ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
base_dir=$(dirname "$0")
|
||||
base_dir="${DEPOT_TOOLS_DIR}"
|
||||
if [ -e "$base_dir/.disable_auto_update" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user