Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Calling an imported task with dependencies fails #151

@dolwitz-at-sony

Description

@dolwitz-at-sony

Consider the two task files below:
Main task file:

version: '2'

includes:
  imported: ./imported

tasks:
  main:
    desc: Delegates to task in imported task file
    cmds:
      - echo "Calling subtask"
      - task: imported:subtask

#  dependency:
#    desc: subtask is dependant on this task
#    cmds:
#      - echo Running dependency

Imported task file:

version: '2'

tasks:
  dependency:
    desc: subtask is dependant on this task
    cmds:
      - echo Running dependency
  
  subtask:
    desc: Executes a subtask with dependency.
    deps:
      - task: dependency
    cmds:
      - echo Running subtask

Executing yields:

$task main
echo "Calling subtask"
Calling subtask
task: Failed to run task "main": task: Task "dependency" not found

If I enable the commented out lines in the main task file I get the following:

$task main
echo "Calling subtask"
Calling subtask
echo Running dependency
Running dependency
echo Running subtask
Running subtask

Seems like the task in the imported task file is using the wrong context when looking for its dependencies. It looks the main task file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions