mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Print helpful error message when updating depot_tools on Windows
The depot_tools directory may get into a state in which its no longer a git repo, in which case we can't update it. On Windows this would cause the update_depot_tools.bat script to fail with a somewhat confusing error message, this CL fixes that to inform the user what happened and what they should do about it. Bug: 1333997 Change-Id: I2c60fc46f1fae7811ff6610e25380d08010d0597 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3718926 Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Commit-Queue: Will Cassella <cassew@chromium.org> Reviewed-by: Brian Sheedy <bsheedy@chromium.org> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
This commit is contained in:
@@ -48,6 +48,13 @@ if errorlevel 1 (
|
||||
:: Now clear errorlevel so it can be set by other programs later.
|
||||
set errorlevel=
|
||||
|
||||
:: Make sure DEPOT_TOOLS_DIR is a git repo
|
||||
IF NOT EXIST "%DEPOT_TOOLS_DIR%.git\" (
|
||||
echo Error: Your depot_tools directory does not appear to be a git repository, and cannot be updated.
|
||||
echo Consider deleting your depot_tools directory and following the instructions at https://www.chromium.org/developers/how-tos/install-depot-tools/ to reinstall it.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
cd /d "%DEPOT_TOOLS_DIR%."
|
||||
call git config remote.origin.fetch > NUL
|
||||
for /F %%x in ('git config --get remote.origin.url') DO (
|
||||
|
||||
Reference in New Issue
Block a user