diff --git a/vendor/init.bat b/vendor/init.bat index 86e6d65..96ad751 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -235,7 +235,9 @@ goto :CONFIGURE_GIT :CONFIGURE_GIT %lib_console% debug_output "Using Git from '%GIT_INSTALL_ROOT%..." :: Add git to the path -rem add the unix commands at the end to not shadow windows commands like more +if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" "" + +:: Add the unix commands at the end to not shadow windows commands like more if %nix_tools% equ 1 ( %lib_console% verbose_output "Preferring Windows commands" set "path_position=append" @@ -244,7 +246,6 @@ if %nix_tools% equ 1 ( set "path_position=" ) -if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" %path_position% if %nix_tools% geq 1 ( if exist "%GIT_INSTALL_ROOT%\mingw32" ( %lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position% diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index 239e853..b55ff6a 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -231,26 +231,28 @@ exit /b :::------------------------------------------------------------------------------- :compare_git_versions - if %errorlevel% geq 0 ( + if ERRORLEVEL 0 ( :: compare the user git version against the vendored version %lib_git% compare_versions USER VENDORED :: use the user provided git if its version is greater than, or equal to the vendored git - if %errorlevel% geq 0 if exist "%test_dir:~0,-4%\cmd\git.exe" ( - set "GIT_INSTALL_ROOT=%test_dir:~0,-4%" - set test_dir= - ) else if %errorlevel% geq 0 ( - set "GIT_INSTALL_ROOT=%test_dir%" - set test_dir= + if ERRORLEVEL 0 ( + if exist "%test_dir:~0,-4%\cmd\git.exe" ( + set "GIT_INSTALL_ROOT=%test_dir:~0,-4%" + set test_dir= + ) else ( + set "GIT_INSTALL_ROOT=%test_dir%" + set test_dir= + ) ) else ( - call :verbose_output Found old %GIT_VERSION_USER% in "%test_dir%", but not using... + %lib_console% verbose_output "Found old %GIT_VERSION_USER% in %test_dir%, but not using..." set test_dir= ) ) else ( :: compare the user git version against the vendored version :: if the user provided git executable is not found - if %errorlevel% equ -255 ( - call :verbose_output No git at "%git_executable%" found. + IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 ( + %lib_console% verbose_output "No git at "%git_executable%" found." set test_dir= ) )