Documentation
¶
Index ¶
- 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 RemoteExists(ctx context.Context, l *logger.Logger, u *url.URL) (*url.URL, error)
- type BaseNode
- type Cache
- type FileNode
- func (node *FileNode) FilenameAndLastDir() (string, string)
- func (node *FileNode) Location() string
- func (node *FileNode) Read(ctx context.Context) ([]byte, error)
- func (node *FileNode) Remote() bool
- func (node *FileNode) ResolveDir(dir string) (string, error)
- func (node *FileNode) ResolveEntrypoint(entrypoint string) (string, error)
- type HTTPNode
- func (node *HTTPNode) FilenameAndLastDir() (string, string)
- func (node *HTTPNode) Location() string
- func (node *HTTPNode) Read(ctx context.Context) ([]byte, error)
- func (node *HTTPNode) Remote() bool
- func (node *HTTPNode) ResolveDir(dir string) (string, error)
- func (node *HTTPNode) ResolveEntrypoint(entrypoint string) (string, error)
- type Node
- type NodeOption
- type Reader
- type StdinNode
- func (node *StdinNode) FilenameAndLastDir() (string, string)
- func (node *StdinNode) Location() string
- func (node *StdinNode) Read(ctx context.Context) ([]byte, error)
- func (node *StdinNode) Remote() bool
- func (node *StdinNode) ResolveDir(dir string) (string, error)
- func (node *StdinNode) ResolveEntrypoint(entrypoint string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exists ¶
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 ¶
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 RemoteExists ¶
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 ¶
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode is a generic node that implements the Parent() 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 ¶
func NewBaseNode(dir string, opts ...NodeOption) *BaseNode
type FileNode ¶
A FileNode is a node that reads a taskfile from the local filesystem.
func NewFileNode ¶
func (*FileNode) FilenameAndLastDir ¶
type HTTPNode ¶
An HTTPNode is a node that reads a Taskfile from a remote location via HTTP.
func NewHTTPNode ¶
func (*HTTPNode) FilenameAndLastDir ¶
type Node ¶
type Node interface { Read(ctx context.Context) ([]byte, error) Parent() Node Location() string Dir() string Remote() bool ResolveEntrypoint(entrypoint string) (string, error) ResolveDir(dir string) (string, error) FilenameAndLastDir() (string, string) }
type NodeOption ¶
type NodeOption func(*BaseNode)
func WithParent ¶
func WithParent(parent Node) NodeOption
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
A Reader will recursively read Taskfiles from a given source using a directed acyclic graph (DAG).
type StdinNode ¶
type StdinNode struct {
*BaseNode
}
A StdinNode is a node that reads a taskfile from the standard input stream.