version: '3'

silent: true

vars:
  PREFIX: EXIT_CODE=

tasks:
  exit-zero:
    vars:
      FOO: bar
      DYNAMIC_FOO:
        sh: echo 'bar'
    cmds:
      - defer: echo FOO={{.FOO}} - DYNAMIC_FOO={{.DYNAMIC_FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
      - exit 0

  exit-one:
    vars:
      FOO: bar
      DYNAMIC_FOO:
        sh: echo 'bar'
    cmds:
      - defer: echo FOO={{.FOO}} - DYNAMIC_FOO={{.DYNAMIC_FOO}} - {{.PREFIX}}{{.EXIT_CODE}}
      - exit 1
