Search code examples
command-lineteamcity

command line variable does not increment on build script


For teamcity. The output of code below, passcount is '0' but it should be 4 based on I know it is doing 4 passes. command line script (abbreviated):

result=0
passcount=0
for layer in %project.layers%; do
   //     some stuff...
 result=$?
 if [[ "$result" -ne 0 ]]; then
    break;
 else
    passcount++
    echo " $layer Succeeded"
 fi
done

Solution

  • Take passcount++ into double brackets, i.e. ((passcount++))