From 08e2e0cc9dc3404f1905a2f2741a8553c86d6f77 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 3 Aug 2023 17:55:52 +0000 Subject: [PATCH] update_depot_tools: always resolve base_dir with dirname Other depot_tools scripts use dirname regardless of mingw, so do that here too to simplify. Bug: 1469696 Change-Id: I9a70975ef5614b1107ac87a5dc29b5ee1a06e298 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4750039 Reviewed-by: Josip Sokcevic Commit-Queue: Mike Frysinger --- update_depot_tools | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/update_depot_tools b/update_depot_tools index 0c5727f2e..f1505d031 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -25,21 +25,16 @@ if [ $MSYS = 0 ]; then echo fi +base_dir=$(dirname "$0") +if [ -e "$base_dir/.disable_auto_update" ]; then + exit +fi + # Test if this script is running under a MinGW install. If it is, we will # hardcode the paths to Git where possible. OUTPUT="$(uname | grep 'MINGW')" MINGW=$? -if [ $MINGW = 0 ]; then - base_dir="${0%/*}" -else - base_dir=$(dirname "$0") -fi - -if [ -e "$base_dir/.disable_auto_update" ]; then - exit -fi - # We want to update the bundled tools even under MinGW. if [ $MINGW = 0 ]; then $COMSPEC //c `cygpath -w "$base_dir/bootstrap/win_tools.bat"`