1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

Revert "fix: .USER_WORKING_DIR should contain the value of --dir if given (#2186)"

This reverts commit 768dca053b.
This commit is contained in:
Pete Davison
2025-04-27 22:14:50 +00:00
parent 6cb0a5a2f2
commit 68d5095761
4 changed files with 2 additions and 10 deletions

View File

@@ -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
}

View File

@@ -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),
)

View File

@@ -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. |

View File

@@ -61,12 +61,6 @@ In this example, we can run `cd <service>` and `task up` and as long as the
`<service>` 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