Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special variable for absolute path of task directory #1959

Open
vmaerten opened this issue Dec 15, 2024 · 0 comments · May be fixed by #1961
Open

special variable for absolute path of task directory #1959

vmaerten opened this issue Dec 15, 2024 · 0 comments · May be fixed by #1961
Assignees
Labels
area: variables Changes related to variables.

Comments

@vmaerten
Copy link
Member

Discussed in #1957

Originally posted by lesomnus December 14, 2024
Assume I run following taskfile at /home/lesomnus/foo:

version: "3"

tasks:
  hello:
    dir: bar
    cmds:
      - echo $(pwd)

It will print /home/lesomnus/foo/bar.
However, I believe it should be templated rather than executing pwd.

There was an issue about it at #525 but is closed as duplication of #215 but #215 does not state that.

Maybe I can:

version: "3"

tasks:
  gen-proto:
    dir: proto
    vars:
      PWD:
        sh: pwd
    cmds:
      - echo {{.PWD}}

but it is too verbose.

Is there already a special variable for this?

@vmaerten vmaerten added area: variables Changes related to variables. type: enhancement labels Dec 15, 2024
@vmaerten vmaerten linked a pull request Dec 15, 2024 that will close this issue
@vmaerten vmaerten linked a pull request Dec 15, 2024 that will close this issue
@vmaerten vmaerten self-assigned this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: variables Changes related to variables.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants