Skip to content

Nested tasks should inherit the calling task's dir #585

@amancevice

Description

@amancevice
  • Task version: 3.9.0
  • Operating System: macOS 11.6 (Big Sur)

Example Taskfile showing the issue

When a task invokes another task as part of its cmds block, the called task should inherit the dir of the calling task.

Consider the following taskfile at /tmp/task/Taskfile.yml:

---
version: "3"
tasks:
  inner:
    cmds:
      - pwd
  outer:
    dir: inner
    cmds:
      - pwd
      - task: inner

I would expect the command task outer to produce:

/tmp/task/inner
/tmp/task/inner

but instead it produces:

/tmp/task/inner
/tmp/task

I think this is unexpected behavior, but I'm happy to hear another point of view

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions