mirror of
https://github.com/go-task/task.git
synced 2026-06-27 06:34:18 +00:00
feat: remote taskfile improvements (cache/expiry) (#2176)
* feat: cache as node, RemoteNode and cache-first approach * feat: cache expiry * feat: pass ctx into reader methods instead of timeout * docs: updated remote taskfiles experiment doc * feat: use cache if download fails
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package taskfile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -34,11 +33,7 @@ func (node *FileNode) Location() string {
|
||||
return node.Entrypoint
|
||||
}
|
||||
|
||||
func (node *FileNode) Remote() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (node *FileNode) Read(ctx context.Context) ([]byte, error) {
|
||||
func (node *FileNode) Read() ([]byte, error) {
|
||||
f, err := os.Open(node.Location())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -114,7 +109,3 @@ func (node *FileNode) ResolveDir(dir string) (string, error) {
|
||||
entrypointDir := filepath.Dir(node.Entrypoint)
|
||||
return filepathext.SmartJoin(entrypointDir, path), nil
|
||||
}
|
||||
|
||||
func (node *FileNode) FilenameAndLastDir() (string, string) {
|
||||
return "", filepath.Base(node.Entrypoint)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user