Created
March 30, 2013 17:39
-
-
Save Ruzzz/5277606 to your computer and use it in GitHub Desktop.
Read and return version of project from string #define VERSION "_VER_"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Init | |
set ROOT_PATH=%~dp0..\.. | |
rem get #define VERSION "_VER_" | |
for /f "tokens=* delims= " %%a in (%ROOT_PATH%\src\defs.h) do ( | |
echo %%a | find "VERSION" > nul | |
if not errorlevel 1 set LINE=%%a | |
) | |
rem get "_VER_" | |
for /f "tokens=3 delims= " %%a in ('echo %LINE%') do ( | |
set VERSION_QUOTE=%%a | |
) | |
rem get _VER_ | |
set VERSION=%VERSION_QUOTE:~1,-1% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment