Documentation ¶
Index ¶
- Variables
- func Dotenv(c *compiler.Compiler, tf *ast.Taskfile, dir string) (*ast.Vars, error)
- func Exists(l *logger.Logger, path string) (string, error)
- func ExistsWalk(l *logger.Logger, path string) (string, error)
- func Read(node Node, insecure bool, download bool, offline bool, timeout time.Duration, ...) (*ast.Taskfile, error)
- func RemoteExists(ctx context.Context, l *logger.Logger, u *url.URL) (*url.URL, error)
- type BaseNode
- type Cache
- type FileNode
- type HTTPNode
- type Node
- type NodeOption
- type StdinNode
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIncludedTaskfilesCantHaveDotenvs is returned when a included Taskfile contains dotenvs ErrIncludedTaskfilesCantHaveDotenvs = errors.New("task: Included Taskfiles can't have dotenv declarations. Please, move the dotenv declaration to the main Taskfile") )
Functions ¶
func Exists ¶ added in v3.34.0
Exists will check if a file at the given path Exists. If it does, it will return the path to it. If it does not, it will search for any files at the given path with any of the default Taskfile files names. If any of these match a file, the first matching path will be returned. If no files are found, an error will be returned.
func ExistsWalk ¶ added in v3.34.0
ExistsWalk will check if a file at the given path exists by calling the exists function. If a file is not found, it will walk up the directory tree calling the exists function until it finds a file or reaches the root directory. On supported operating systems, it will also check if the user ID of the directory changes and abort if it does.
func Read ¶ added in v3.34.0
func Read( node Node, insecure bool, download bool, offline bool, timeout time.Duration, tempDir string, l *logger.Logger, ) (*ast.Taskfile, error)
Read reads a Read for a given directory Uses current dir when dir is left empty. Uses Read.yml or Read.yaml when entrypoint is left empty
func RemoteExists ¶ added in v3.36.0
RemoteExists will check if a file at the given URL Exists. If it does, it will return its URL. If it does not, it will search the search for any files at the given URL with any of the default Taskfile files names. If any of these match a file, the first matching path will be returned. If no files are found, an error will be returned.
Types ¶
type BaseNode ¶ added in v3.34.0
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode is a generic node that implements the Parent() and Optional() methods of the NodeReader interface. It does not implement the Read() method and it designed to be embedded in other node types so that this boilerplate code does not need to be repeated.
func NewBaseNode ¶ added in v3.34.0
func NewBaseNode(dir string, opts ...NodeOption) *BaseNode
type FileNode ¶ added in v3.34.0
A FileNode is a node that reads a taskfile from the local filesystem.
func NewFileNode ¶ added in v3.34.0
func (*FileNode) ResolveDir ¶ added in v3.36.0
type HTTPNode ¶ added in v3.34.0
An HTTPNode is a node that reads a Taskfile from a remote location via HTTP.
func NewHTTPNode ¶ added in v3.34.0
func (*HTTPNode) ResolveDir ¶ added in v3.36.0
type Node ¶ added in v3.34.0
type Node interface { Read(ctx context.Context) ([]byte, error) Parent() Node Location() string Dir() string Optional() bool Remote() bool ResolveEntrypoint(entrypoint string) (string, error) ResolveDir(dir string) (string, error) }
type NodeOption ¶ added in v3.34.0
type NodeOption func(*BaseNode)
func WithOptional ¶ added in v3.34.0
func WithOptional(optional bool) NodeOption
func WithParent ¶ added in v3.34.0
func WithParent(parent Node) NodeOption
type StdinNode ¶ added in v3.35.0
type StdinNode struct {
*BaseNode
}
A StdinNode is a node that reads a taskfile from the standard input stream.