Skip to content

Global variables and included taskfile #696

@aliculPix4D

Description

@aliculPix4D
  • Task version: v3.9.0
  • Operating System: ubuntu 20.04

Very similar issue: #618

Hi, first thank you for the great tool. I would like to report what my team and I consider a bug (unexpected behavior) and to check your opinion on the topic.

Consider the following setup:

  • first Taskfile in the root directory: Taskfile.yml
version: '3'

includes:
  imported: import/Taskfile.yml

vars:
  custom_value: root

tasks:
  print_var:
    cmds:
      - echo {{.custom_value}}
  • second in the sub directory: import and included from the root Taskfile
version: '3'

vars:
  custom_value: included

tasks:
  print_var:
    cmds:
      - echo {{.custom_value}}

Running the following commands:

>  task imported:print_var
task: [imported:print_var] echo included
included
> task print_var  
task: [print_var] echo included
included

While our expectation were more in line with the following:

>  task imported:print_var
task: [imported:print_var] echo included
included
> task print_var  
task: [print_var] echo root
root

where the root task would print the value set in root Taskfile.

Thanks for looking at this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions