version: '3'

vars:
  PORTUGUESE_HELLO_WORLD: Olá, mundo!
  GERMAN: Hello

tasks:
  default:
    vars:
      SPANISH: ¡Holla mundo!
      PORTUGUESE: "{{.PORTUGUESE_HELLO_WORLD}}"
      GERMAN: "Welt!"
    deps:
      - task: write-file
        vars: {CONTENT: Dependence1}
      - task: write-file
        vars: {CONTENT: Dependence2}
      - task: write-file
        vars: {CONTENT: "{{.SPANISH|replace \"mundo\" \"dependencia\"}}"}
    cmds:
      - task: write-file
        vars: {CONTENT: Hello}
      - task: write-file
        vars: {CONTENT: "$echo 'World'"}
      - task: write-file
        vars: {CONTENT: "!"}
      - task: write-file
        vars: {CONTENT: "{{.SPANISH}}"}
      - task: write-file
        vars: {CONTENT: "{{.PORTUGUESE}}"}
      - task: write-file
        vars: {CONTENT: "{{.GERMAN}}"}
      - task: non-default

  write-file:
    cmds:
      - echo {{.CONTENT}}

  non-default:
    vars:
      PORTUGUESE: "{{.PORTUGUESE_HELLO_WORLD}}"
    cmds:
      - task: write-file
        vars: {CONTENT: "{{.PORTUGUESE}}"}
