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

Template variable containing absolute path to root taskfile #1468

Closed
PrincessRTFM opened this issue Jan 12, 2024 · 1 comment · Fixed by #1469
Closed

Template variable containing absolute path to root taskfile #1468

PrincessRTFM opened this issue Jan 12, 2024 · 1 comment · Fixed by #1469
Labels
area: variables Changes related to variables. type: feature A new feature or functionality.

Comments

@PrincessRTFM
Copy link

My particular use case for wanting to provide this value is that I would like to define a default task that will run task -t "{{.ROOT_FILE}}" --list, such that calling task without a specific task name will print the basic help for the file. There are other possibilities, such as a task that copies some user-created template taskfile into the invocation directory, which could be accomplished via cp "{{.ROOT_FILE}}" "{{.USER_WORKING_DIR}}" on linux systems. At present, no such commands are possible.

Currently, the .ROOT_DIR variable provides only the directory of the root taskfile, which can be passed to task -d "{{.ROOT_DIR}}" --list for that particular use case. However, since the CLI accepts the -t/--taskfile argument, it is possible for a non-default filename to be used, which would prevent any task commands from definitively knowing the actual file being run.

As a side note, it may also be useful to have such a variable for included task files as well, although I don't have a specific use case for such.

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Jan 12, 2024
@pd93 pd93 added type: feature A new feature or functionality. area: variables Changes related to variables. and removed state: needs triage Waiting to be triaged by a maintainer. labels Jan 12, 2024
@pd93
Copy link
Member

pd93 commented Jan 12, 2024

Seems pretty reasonable to me. See #1469

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. type: feature A new feature or functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants