diff --git a/executor.go b/executor.go index cb846464..8f9233ef 100644 --- a/executor.go +++ b/executor.go @@ -4,7 +4,6 @@ import ( "context" "io" "os" - "path/filepath" "sync" "time" @@ -123,7 +122,6 @@ type dirOption struct { } func (o *dirOption) ApplyToExecutor(e *Executor) { - e.UserWorkingDir, _ = filepath.Abs(o.dir) e.Dir = o.dir } diff --git a/task_test.go b/task_test.go index aeaa9317..5ac47c25 100644 --- a/task_test.go +++ b/task_test.go @@ -2151,7 +2151,7 @@ func TestUserWorkingDirectory(t *testing.T) { var buff bytes.Buffer e := task.NewExecutor( - task.WithEntrypoint("testdata/user_working_dir/Taskfile.yml"), + task.WithDir("testdata/user_working_dir"), task.WithStdout(&buff), task.WithStderr(&buff), ) diff --git a/website/docs/reference/templating.mdx b/website/docs/reference/templating.mdx index fc5e4fb0..98d45bae 100644 --- a/website/docs/reference/templating.mdx +++ b/website/docs/reference/templating.mdx @@ -115,7 +115,7 @@ special variable will be overridden. | `TASKFILE` | The absolute path of the included Taskfile. | | `TASKFILE_DIR` | The absolute path of the included Taskfile directory. | | `TASK_DIR` | The absolute path of the directory where the task is executed. | -| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from, or the value of `--dir` (`-d`) if given. | +| `USER_WORKING_DIR` | The absolute path of the directory `task` was called from. | | `CHECKSUM` | The checksum of the files listed in `sources`. Only available within the `status` prop and if method is set to `checksum`. | | `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`. | | `TASK_VERSION` | The current version of task. | diff --git a/website/docs/usage.mdx b/website/docs/usage.mdx index e672cf82..1942d947 100644 --- a/website/docs/usage.mdx +++ b/website/docs/usage.mdx @@ -61,12 +61,6 @@ In this example, we can run `cd ` and `task up` and as long as the `` directory contains a `docker-compose.yml`, the Docker composition will be brought up. -:::info - -`.USER_WORKING_DIR` will contain the value of the `--dir` (`-d`) flag, if given. - -::: - ### Running a global Taskfile If you call Task with the `--global` (alias `-g`) flag, it will look for your