所以我使用相同的批处理脚本构建多个客户端。如果在构建一个错误时出现错误,那么这个过程会停止并继续下一个过程。由于屏幕上有很多输出,我正在做其他事情,大多数时候我都会错过有一个构建错误。在遇到错误时停止执行批处理脚本
如果出现错误,并且显示弹出消息以引起我的注意,是否有办法停止执行以下任务?或者至少停止执行,所以当我回到命令窗口时,我可以看到有一个失败?
@echo off
if "%1"=="?" GOTO HELP
if NOT "%1"=="" set rev=%1
if NOT "%2"=="" set version=%2
@echo on
rem build one
call perl buildClient.pl -brandName="myBrand" -group="group1"
rem build two
call perl buildClient.pl -brandName="myBrand" -group="group2"
rem build three
call perl buildClient.pl -brandName="myBrand" -group="group3"
rem build four
call perl buildClient.pl -brandName="myBrand" -group="group4"
@echo off
goto EXIT
:HELP
cls
echo.
echo.
echo usage: buildbrand.bat [revision] [version] [group]
echo.
echo ? = this help screen
echo.
echo revision = build version
echo Example: 5.2.31
echo group = group of phones or phone name
echo Example: SonyEricsson\K750
echo.
:EXIT
set version=
set rev=
set brandName=
PAUSE
比方说,建设1组失败。我想停在那里,让我自己通知,而不是继续处理group2。 – Tony 2013-03-05 22:31:27
我不是100%确定的,但我认为像'call command arguments || echo命令失败&&暂停'应该工作。 – 2013-03-05 22:35:50
@ProfPickle这是假设perl给出了一个错误的级别,我会认为它没有。托尼如果失败会给出什么输出? – 2013-03-05 23:01:13