Skip to content

Commit d3e766b

Browse files
PhilipOakleydscho
authored andcommitted
vcpkg_install: detect lack of Git
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 <[email protected]>
1 parent 787bfe4 commit d3e766b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compat/vcbuild/vcpkg_install.bat

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ REM ================================================================
3636

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

39+
git.exe version 2>nul
40+
IF ERRORLEVEL 1 (
41+
echo "***"
42+
echo "Git not found. Please adjust your CMD path or Git install option."
43+
echo "***"
44+
EXIT /B 1 )
45+
3946
echo Fetching vcpkg in %cwd%vcpkg
4047
git.exe clone https://github.com/Microsoft/vcpkg vcpkg
4148
IF ERRORLEVEL 1 ( EXIT /B 1 )

0 commit comments

Comments
 (0)