feat: Add temp dir option (#2891)

Co-authored-by: Valentin Maerten <maerten.valentin@gmail.com>
This commit is contained in:
kjasn
2026-06-29 22:13:37 +08:00
committed by GitHub
parent f9e52fab40
commit 1c743de2b7
10 changed files with 99 additions and 8 deletions

View File

@@ -220,6 +220,18 @@ Run the global Taskfile from `$HOME/Taskfile.{yml,yaml}`.
task backup --global
```
#### `--temp-dir <path>`
Set the directory used to store Task temporary files, such as checksums.
Relative paths are relative to the root Taskfile.
- **Config equivalent**: [`temp-dir`](./config.md#temp-dir)
- **Environment variable**: [`TASK_TEMP_DIR`](./environment.md#task-temp-dir)
```bash
task build --temp-dir .task-cache
```
### Output Control
#### `-o, --output <mode>`

View File

@@ -166,6 +166,18 @@ failfast: true
interactive: true
```
### `temp-dir`
- **Type**: `string`
- **Default**: `./.task`
- **Description**: Directory to store Task temporary files, such as checksums
and temporary metadata. Relative paths are relative to the root Taskfile.
- **Environment variable**: [`TASK_TEMP_DIR`](./environment.md#task-temp-dir)
```yaml
temp-dir: .task
```
## Example Configuration
Here's a complete example of a `.taskrc.yml` file with all available options:
@@ -177,6 +189,7 @@ silent: false
color: true
disable-fuzzy: false
concurrency: 2
temp-dir: .task
# Enable experimental features
experiments:

View File

@@ -88,6 +88,10 @@
"description": "Prompt for missing required variables instead of failing. Requires a TTY.",
"type": "boolean",
"default": false
},
"temp-dir": {
"type": "string",
"description": "Directory to store Task temporary files, such as checksums and temporary metadata. Relative paths are relative to the root Taskfile."
}
},
"additionalProperties": false