Description
When I set dir: '{{.USER_WORKING_DIR}}', my tasks are run inside a subdirectory in the current directory, instead of within the directory my shell is in.
———————————————————————————————————————————————————————————————[ 04:33:04 ]————
/…/Bug Reports/Taskfile Backslash Space $ tree .
.
├── sub-directory
│ └── sub-sub-directory with spaces
└── Taskfile.yml
3 directories, 1 file
———————————————————————————————————————————————————————————————[ 04:33:06 ]————
/…/Bug Reports/Taskfile Backslash Space $ cat Taskfile.yml
version: '3'
tasks:
tree-parent:
desc: tree
dir: '{{.USER_WORKING_DIR}}'
cmds:
- echo "{{.USER_WORKING_DIR}}"
- tree .
———————————————————————————————————————————————————————————————[ 04:33:09 ]————
/…/Bug Reports/Taskfile Backslash Space $ tree .
.
├── sub-directory
│ └── sub-sub-directory with spaces
└── Taskfile.yml
3 directories, 1 file
———————————————————————————————————————————————————————————————[ 04:33:13 ]————
/…/Bug Reports/Taskfile Backslash Space $ t tree-parent
task: [tree-parent] echo "/…/Bug Reports/Taskfile Backslash Space"
/…/Bug Reports/Taskfile Backslash Space
task: [tree-parent] tree .
.
└── subdirectory\ with\ spaces
2 directories, 0 files
———————————————————————————————————————————————————————————————[ 04:33:20 ]————
/…/Bug Reports/Taskfile Backslash Space $
Expected
- When I run
t tree-parent (t is an alias for task), I expect it to show the same output as running tree . directly in the same directory.
Actual
- Even though
task reports the {{.USER_WORKING_DIR}} correctly, it runs the task in sub-directory instead.
Without dir: '{{.USER_WORKING_DIR}}', this works as expected.
I’m also seeing some other wonkiness where task is in fact creating brand new subdirectories on disk. If sub directory with spaces exists on disk, Task creates sub\ directory\ with\ spaces alongside it — the backslashes are present in the actual filename, not escape characters, on macOS. I’m trying to prepare a minimal repro case for it, but ran into this current issue in the process of doing that.
Version
3.43.2
Operating system
macOS
Experiments Enabled
No response
Example Taskfile
version: '3'
tasks:
tree-parent:
desc: tree
dir: '{{.USER_WORKING_DIR}}'
cmds:
- echo "{{.USER_WORKING_DIR}}"
- tree .
Description
When I set
dir: '{{.USER_WORKING_DIR}}', my tasks are run inside a subdirectory in the current directory, instead of within the directory my shell is in.Expected
t tree-parent(tis an alias fortask), I expect it to show the same output as runningtree .directly in the same directory.Actual
taskreports the{{.USER_WORKING_DIR}}correctly, it runs the task insub-directoryinstead.Without
dir: '{{.USER_WORKING_DIR}}', this works as expected.I’m also seeing some other wonkiness where
taskis in fact creating brand new subdirectories on disk. Ifsub directory with spacesexists on disk, Task createssub\ directory\ with\ spacesalongside it — the backslashes are present in the actual filename, not escape characters, on macOS. I’m trying to prepare a minimal repro case for it, but ran into this current issue in the process of doing that.Version
3.43.2
Operating system
macOS
Experiments Enabled
No response
Example Taskfile