github.com/jenkins-x/jx/v2@v2.1.155/pkg/util/test_data/scripts/fail_iterator.bat (about)

     1  @echo off
     2  setlocal EnableDelayedExpansion
     3  
     4  REM This script is intended to be used to match a pass attempt in a loop. Currently used in command_test.go
     5  
     6  set _file=%1
     7  
     8  if exist !_file! (
     9      set /p TRY=<!_file!
    10      if "!TRY!" == "" (
    11          set TRY=1
    12      )
    13  ) else (
    14      set TRY=1
    15  )
    16  
    17  set PASS_ATTEMPT=%2
    18  
    19  if "!TRY!" == "!PASS_ATTEMPT!" (
    20      echo PASS
    21      set /a TRY=!TRY!+1
    22      echo !TRY!>!_file!
    23      exit 0
    24  ) else (
    25      echo FAILURE^^!
    26      set /a TRY=!TRY!+1
    27      echo !TRY!>!_file!
    28      exit 1
    29  )