Skip to content

Dir not working properly when importing a Taskfile #2497

@segator

Description

@segator

Description

I Isolated the problem into this 2 taskfiles
(See the examples)

Run task lint

and ..

task lint
task: [lint] echo "/Users/xxxxx/Documents/projects/test/test2"
/Users/xxxxx/Documents/projects/test/test2
task: [lint] echo "/Users/xxxxx/Documents/projects/test/test2"
/Users/xxxxx/Documents/projects/test/test2
task: [lint] echo $(pwd)
/Users/xxxxx/Documents/projects/test/test2/Users/xxxxx/Documents/projects/test/test2

notice that the output of pwd prints twice the path so it is wrong.

I tried with having the common task in the same root folder but same problem.

Version

3.45.4

Operating system

Darwin arm64

Experiments Enabled

No response

Example Taskfile

root taskfile

version: '3'

includes:
  chart:
    flatten: true
    taskfile: ../../scripts/taskfile.common.yml


imported taskfile


version: '3'

vars:
  CHART_DIR: '{{coalesce .CHART_DIR .USER_WORKING_DIR}}'

tasks:
  lint:
    desc: Lint Helm chart
    dir: '{{.CHART_DIR}}'
    cmds:
      - echo "{{.USER_WORKING_DIR}}"
      - echo "{{.CHART_DIR }}"
      - echo $(pwd)

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions