Skip to content

Commit

Permalink
vcpkg_install: detect lack of Git
Browse files Browse the repository at this point in the history
The vcpkg_install batch file depends on the availability of a
working Git on the CMD path. This may not be present if the user
has selected the 'bash only' option during Git-for-Windows install.

Detect and tell the user about their lack of a working Git in the CMD
window.

Fixes #2348.
A separate PR git-for-windows/build-extra#258
now highlights the recommended path setting during install.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
  • Loading branch information
PhilipOakley authored and Git for Windows Build Agent committed Oct 25, 2024
1 parent e7b97ea commit 847dabf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compat/vcbuild/vcpkg_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ REM ================================================================

dir vcpkg\vcpkg.exe >nul 2>nul && GOTO :install_libraries

git.exe version 2>nul
IF ERRORLEVEL 1 (
echo "***"
echo "Git not found. Please adjust your CMD path or Git install option."
echo "***"
EXIT /B 1 )

echo Fetching vcpkg in %cwd%vcpkg
git.exe clone https://github.com/Microsoft/vcpkg vcpkg
IF ERRORLEVEL 1 ( EXIT /B 1 )
Expand Down

0 comments on commit 847dabf

Please sign in to comment.