判断是否成功,失败了直接退出,后续命令不再执行

@echo off
git pull
if %errorlevel%==0 (dotnet publish -c Release) else (goto :eof)
:: 后续命令...
  • %errorlevel%==0 上一条指令执行成功
  • %errorlevel%==1 上一条指令执行失败

(完)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
  • 2021-10-28
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-11-11
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案