I've a batch script that I got given to further optimize and plug into our automation framework. I've been able to port it to the automation framework and the scripting in itself works fine. But it fails when a .suo file pre-exists. I've been trying to sneak in an additional check to see if the .suo file pre-exists and delete if so. But it's not working at the /.git/ folder is hidden. I'm obviously missing an attribute perhaps, if any of you could help review the script, that would be great. Thanks in advance:
CALL git --version
FOR /F "tokens=*" %%N IN ('git rev-parse --show-toplevel') DO SET git_path=%%N
IF NOT "%git_path%" EQU "%CD%" exit 1
rem check for fixit file
del /S /F /AH .git\*.suo
CALL git add -Av .
SET /A staged_changes=0
FOR /F "tokens=*" %%N IN ('git status --porcelain') DO SET /A staged_changes=staged_changes+1
IF %staged_changes% EQU 0 exit 0
CALL git commit --author=tst_usr --quiet --untracked-files=no --message=backup
CALL git whatchanged --no-abbrev -M --pretty=raw HEAD~1..HEAD>"%WORKSPACE%\..\builds\%BUILD_ID%\log.xml"
CALL git push origin master
CALL git tag %tag%
CALL git push origin tag %tag%
message edited by karthikd