I have a .bat and inside the .bat i would like to execute a special code if there's some modification inside the svn repository (for example, compile).
For Win 2000 and later, this would assign the last output row from the svn status commmand to the svnOut variable and then test if the variable contains anything:
@echo off
set svnOut=
set svnDir=C:Your\path\to\svn\dir\to\check
for /F "tokens=*" %%I in ('svn status %svnDir%') do set svnOut=%%I
if "%svnOut%"=="" (
echo No changes
) else (
echo Changed files!
)
Why there is a line like this
set svnOut=
you have to figure out yourself. ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With