检查代码

来源:互联网 发布:php判断是否微信浏览器 编辑:程序博客网 时间:2024/04/30 05:29
set /a var=0


::在compiler.txt文件中找出来"失败 0 个"的行数,并将其输出在temp.txt
findstr  /i /C:"失败 0 个" compiler.txt > temp.txt


::在temp.txt将找出来的"失败 0 个"的行数进行统计
for /f %%i in (temp.txt) do (
set /a var+=1 
)


echo %var%
del temp.txt


::如果"失败 0 个"的个数不等于工程数,goto到error,否则,goto到success
if %var% NEQ 68 (goto error) else (goto success)




::jenkins的成功机制遇0则显示成功
:success
echo  compile Success.
goto exit




::jenkins的失败机制遇1则显示失败
:error
echo compile Error.
exit 1
goto exit


:exit
@echo on
0 0