From 18953e81bc5e727c3f3081ce01f3cd9bd2807b8a Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sun, 6 Apr 2014 14:38:54 +0300 Subject: [PATCH] Visual Studio re-Fix: and also build if git is available --- common/vsprops/preBuild.cmd | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/common/vsprops/preBuild.cmd b/common/vsprops/preBuild.cmd index 6be1a3a4dc..509b0b4b3a 100644 --- a/common/vsprops/preBuild.cmd +++ b/common/vsprops/preBuild.cmd @@ -21,7 +21,14 @@ IF "%PROGRAMFILES(x86)%" == "" do ( set PATH=%PATH%;"%PROGRAMFILES(x86)%\Git\bin" -rem Test if git is available for this repo +FOR /F "delims=+" %%i IN ('"git show -s --format=%%%ci HEAD"') do ( + set REV3=%%i +) + +set REV2=%REV3: =% +set REV1=%REV2:-=% +set REV=%REV1::=% + git show -s if %ERRORLEVEL% NEQ 0 ( echo Automatic version detection unavailable. @@ -35,14 +42,6 @@ if %ERRORLEVEL% NEQ 0 ( echo #define SVN_MODS 0 >> "%CD%\svnrev.h" echo set SVN_REV=0 > "%CD%\postBuild.inc.cmd" ) else ( - - FOR /F "delims=+" %%i IN ('"git show -s --format=%%%ci HEAD"') do ( - set REV3=%%i - ) - set REV2=%REV3: =% - set REV1=%REV2:-=% - set REV=%REV1::=% - echo #define SVN_REV %REV%ll > "%CD%\svnrev.h" echo #define SVN_MODS 0 /* Not implemented at the moment. */ >> "%CD%\svnrev.h" echo set SVN_REV=%REV% > "%CD%\postBuild.inc.cmd"