Skip to content

.ROOT_TASKFILE returns the root directory instead of the file #1706

@cbrown1234

Description

@cbrown1234
  • Task version: v3.38.0 (h1:O7kgA6BfwktXHPrheByQO46p3teKtRuq1EpGnFxNzbo=)
  • Operating system: "Ubuntu 22.04.4 LTS (on WSL2)
  • Experiments enabled: N/A
❯ cat Taskfile.yml
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'

tasks:
  who-am-i:
    cmds:
      - 'echo "Working dir: {{.USER_WORKING_DIR}}"'
      - 'echo "Task: {{.TASK}}"'
      - 'echo "Taskfile: {{.TASKFILE}}"'
      - 'echo "Root Taskfile: {{.ROOT_TASKFILE}}"'

❯ task who-am-i
task: [who-am-i] echo "Working dir: /home/chris/repos/repo-tools-playground"
Working dir: /home/chris/repos/repo-tools-playground
task: [who-am-i] echo "Task: who-am-i"
Task: who-am-i
task: [who-am-i] echo "Taskfile: /home/chris/repos/repo-tools-playground/Taskfile.yml"
Taskfile: /home/chris/repos/repo-tools-playground/Taskfile.yml
task: [who-am-i] echo "Root Taskfile: /home/chris/repos/repo-tools-playground"
Root Taskfile: /home/chris/repos/repo-tools-playground

I would have expected:

Root Taskfile: /home/chris/repos/repo-tools-playground/Taskfile.yml

(I searched for ROOT_TASKFILE in the issues and didn't see any related issues)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: templatingChanges related to the templating engine.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions