-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Description
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(tis an alias fortask), I expect it to show the same output as runningtree .directly in the same directory.
Actual
- Even though
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 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 .Metadata
Metadata
Assignees
Labels
No labels