Fix git-version-gen.cmd when git.cmd is used.

This commit is contained in:
Unknown W. Brackets 2013-03-04 14:02:15 -08:00
parent bf23c6f5e1
commit cd584df821

View File

@ -22,12 +22,11 @@ set GIT_VERSION_FILE=%~p0..\git-version.cpp
if not defined GIT ( if not defined GIT (
set GIT="git" set GIT="git"
) )
call %GIT% describe > NUL 2> NUL
%GIT% describe > NUL 2> NUL
if errorlevel 1 ( if errorlevel 1 (
echo Git not on path, trying default Msysgit paths echo Git not on path, trying default Msysgit paths
set GIT="%ProgramFiles(x86)%\Git\bin\git.exe" set GIT="%ProgramFiles(x86)%\Git\bin\git.exe"
!GIT! describe > NUL 2> NUL call !GIT! describe > NUL 2> NUL
if errorlevel 1 ( if errorlevel 1 (
set GIT="%ProgramFiles%\Git\bin\git.exe" set GIT="%ProgramFiles%\Git\bin\git.exe"
) )
@ -41,7 +40,7 @@ if exist "%GIT_VERSION_FILE%" (
) )
) )
%GIT% describe --always > NUL 2> NUL call %GIT% describe --always > NUL 2> NUL
if errorlevel 1 ( if errorlevel 1 (
echo Unable to update git-version.cpp, git not found. echo Unable to update git-version.cpp, git not found.
echo If you don't want to add it to your path, set the GIT environment variable. echo If you don't want to add it to your path, set the GIT environment variable.
@ -52,7 +51,7 @@ if errorlevel 1 (
goto done goto done
) )
for /F %%I IN ('%GIT% describe --always') do set GIT_VERSION=%%I for /F %%I IN ('call %GIT% describe --always') do set GIT_VERSION=%%I
rem // Don't modify the file if it already has the current version. rem // Don't modify the file if it already has the current version.
if exist "%GIT_VERSION_FILE%" ( if exist "%GIT_VERSION_FILE%" (