@echo off
SetLocal EnableExtensions EnableDelayedExpansion

:Main
set SourceDir=%~dp0
pushd "%SourceDir%" && call :ClearGarbage
popd
goto :EOF

:ClearGarbage
set /a nlib=0
for /f "tokens=* delims=" %%i in ('unix find . -type d ^| unix grep "/backup$"') do unix rm -fvr %%i
for /f "tokens=* delims=" %%i in ('unix find . -type d ^| unix grep "/lib/i386-win32$"') do ( unix rm -fvr %%i & set /a nlib+=1 )
if not "%nlib%" == "0" ( pushd crwdaq & unix strip -v crwdaq.exe & popd & unix sleep 5 )
goto :EOF
