-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Included Taskfiles have wrong working directory with USER_WORKING_DIR #1250
Labels
area: variables
Changes related to variables.
Comments
andarto
pushed a commit
to andarto/task
that referenced
this issue
Jul 21, 2023
…les (go-task#1250) When using `dir: '{{.USER_WORKING_DIR}}'` in an included task, the working directory was set incorrectly by concatenating the base Taskfile directory and the USER_WORKING_DIR.
andreynering
added a commit
that referenced
this issue
Aug 18, 2023
andreynering
added
type: bug
Something not working as intended.
area: variables
Changes related to variables.
and removed
state: needs triage
Waiting to be triaged by a maintainer.
labels
Aug 18, 2023
andreynering
added a commit
that referenced
this issue
Aug 26, 2023
The combination Taskfile.yml
subfolder/Taskfile.yml
Will still run the
I'm no longer sure if this is the intended behavior though! I can work around this by assigning Although I guess the issue is that |
@idelchi I too want to do something similar. # <top_level_folder>/Taskfile.yaml
version: '3'
...
includes:
current:
# internal: true
dir: '{{.USER_WORKING_DIR}}'
taskfile: '{{.USER_WORKING_DIR}}/_Taskfile.yaml'
# optional: true
... # <top_level_folder>/<...>/_Taskfile.yaml
version: '3'
...
tasks:
pwd: pwd
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am having trouble executing tasks from an included file in the current working directory while using Taskfile.yml.
My goal is to be able to navigate to any sub-folder, run a task command, which would use the Taskfile.yml at the root, which in turn includes utilities and commands from other folders.
Here's a minimal example:
Taskfile.yml:
subfolder/Taskfile.info.yml:
When I'm inside the subfolder and run
task info
, the output is (as expected):Adding
dir: '{{.USER_WORKING_DIR}}'
to the include statement in Taskfile.yml, has no effect, while I would have expected it to resolve to /home/user/ws/subfolder.Adding
dir: '{{.USER_WORKING_DIR}}'
to the task in subfolder/Taskfile.info.yml yields:It seems that
USER_WORKING_DIR
resolves to the correct directory, but the commands are not running there. Perhaps I'm using the functionality incorrectly?A use-case is where I'm using the "--global" flag and have the aforementioned structure in my $HOME folder.
I can only get tasks in the 'root' Taskfile to execute in the current working context, but not the included ones.
The text was updated successfully, but these errors were encountered: