mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
feat: add remote.cache-dir taskrc option (#2572)
This commit is contained in:
@@ -284,10 +284,11 @@ and look for a cached copy instead. This timeout can be configured by setting
|
||||
the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will
|
||||
set the timeout to 5 seconds.
|
||||
|
||||
By default, the cache is stored in the Task temp directory, represented by the
|
||||
`TASK_TEMP_DIR` environment variable. You can override the location of the cache
|
||||
by setting the `TASK_REMOTE_DIR` environment variable. This way, you can share
|
||||
the cache between different projects.
|
||||
By default, the cache is stored in the Task temp directory (`.task`). You can
|
||||
override the location of the cache by using the `--remote-cache-dir` flag, the
|
||||
`remote.cache-dir` option in your [configuration file](#cache-dir), or the
|
||||
`TASK_REMOTE_DIR` environment variable. This way, you can share the cache
|
||||
between different projects.
|
||||
|
||||
You can force Task to ignore the cache and download the latest version by using
|
||||
the `--download` flag.
|
||||
@@ -308,6 +309,7 @@ remote:
|
||||
offline: false
|
||||
timeout: "30s"
|
||||
cache-expiry: "24h"
|
||||
cache-dir: ~/.task
|
||||
trusted-hosts:
|
||||
- github.com
|
||||
- gitlab.com
|
||||
@@ -360,6 +362,20 @@ remote:
|
||||
cache-expiry: "6h"
|
||||
```
|
||||
|
||||
#### `cache-dir`
|
||||
|
||||
- **Type**: `string`
|
||||
- **Default**: `.task`
|
||||
- **Description**: Directory where remote Taskfiles are cached. Can be an
|
||||
absolute path (e.g., `/var/cache/task`) or relative to the Taskfile directory.
|
||||
- **CLI equivalent**: `--remote-cache-dir`
|
||||
- **Environment variable**: `TASK_REMOTE_DIR` (lowest priority)
|
||||
|
||||
```yaml
|
||||
remote:
|
||||
cache-dir: ~/.task
|
||||
```
|
||||
|
||||
#### `trusted-hosts`
|
||||
|
||||
- **Type**: `array of strings`
|
||||
|
||||
Reference in New Issue
Block a user