Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 68d5095

Browse files
committedApr 27, 2025
Revert "fix: .USER_WORKING_DIR should contain the value of --dir if given (#2186)"
This reverts commit 768dca0.
1 parent 6cb0a5a commit 68d5095

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed
 

‎executor.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"io"
66
"os"
7-
"path/filepath"
87
"sync"
98
"time"
109

@@ -123,7 +122,6 @@ type dirOption struct {
123122
}
124123

125124
func (o *dirOption) ApplyToExecutor(e *Executor) {
126-
e.UserWorkingDir, _ = filepath.Abs(o.dir)
127125
e.Dir = o.dir
128126
}
129127

‎task_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ func TestUserWorkingDirectory(t *testing.T) {
21512151

21522152
var buff bytes.Buffer
21532153
e := task.NewExecutor(
2154-
task.WithEntrypoint("testdata/user_working_dir/Taskfile.yml"),
2154+
task.WithDir("testdata/user_working_dir"),
21552155
task.WithStdout(&buff),
21562156
task.WithStderr(&buff),
21572157
)

‎website/docs/reference/templating.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ special variable will be overridden.
115115
| `TASKFILE` | The absolute path of the included Taskfile. |
116116
| `TASKFILE_DIR` | The absolute path of the included Taskfile directory. |
117117
| `TASK_DIR` | The absolute path of the directory where the task is executed. |
118-
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from, or the value of `--dir` (`-d`) if given. |
118+
| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. |
119119
| `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. |
120120
| `TIMESTAMP` | The date object of the greatest timestamp of the files listed in `sources`. Only available within the `status` prop and if method is set to `timestamp`. |
121121
| `TASK_VERSION` | The current version of task. |

‎website/docs/usage.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ In this example, we can run `cd <service>` and `task up` and as long as the
6161
`<service>` directory contains a `docker-compose.yml`, the Docker composition
6262
will be brought up.
6363

64-
:::info
65-
66-
`.USER_WORKING_DIR` will contain the value of the `--dir` (`-d`) flag, if given.
67-
68-
:::
69-
7064
### Running a global Taskfile
7165

7266
If you call Task with the `--global` (alias `-g`) flag, it will look for your

0 commit comments

Comments
 (0)
Please sign in to comment.