feat: add remote.cache-dir taskrc option (#2572)

This commit is contained in:
Valentin Maerten
2025-12-18 08:32:11 +01:00
committed by GitHub
parent 28408ef3f4
commit 4ec6c453bd
10 changed files with 56 additions and 16 deletions

View File

@@ -37,6 +37,7 @@ type (
TrustedHosts []string
Timeout time.Duration
CacheExpiryDuration time.Duration
RemoteCacheDir string
Watch bool
Verbose bool
Silent bool
@@ -271,6 +272,19 @@ func (o *cacheExpiryDurationOption) ApplyToExecutor(r *Executor) {
r.CacheExpiryDuration = o.duration
}
// WithRemoteCacheDir sets the directory where remote taskfiles are cached.
func WithRemoteCacheDir(dir string) ExecutorOption {
return &remoteCacheDirOption{dir: dir}
}
type remoteCacheDirOption struct {
dir string
}
func (o *remoteCacheDirOption) ApplyToExecutor(e *Executor) {
e.RemoteCacheDir = o.dir
}
// WithWatch tells the [Executor] to keep running in the background and watch
// for changes to the fingerprint of the tasks that are run. When changes are
// detected, a new task run is triggered.