Documentation
¶
Index ¶
- Constants
- Variables
- func FilterOutInternal(task *taskfile.Task) bool
- func FilterOutNoDesc(task *taskfile.Task) bool
- func InitTaskfile(w io.Writer, dir string) error
- type Executor
- func (e *Executor) CompiledTask(call taskfile.Call) (*taskfile.Task, error)
- func (e *Executor) FastCompiledTask(call taskfile.Call) (*taskfile.Task, error)
- func (e *Executor) GetHash(t *taskfile.Task) (string, error)
- func (e *Executor) GetTask(call taskfile.Call) (*taskfile.Task, error)
- func (e *Executor) GetTaskList(filters ...FilterFunc) ([]*taskfile.Task, error)
- func (e *Executor) InterceptInterruptSignals()
- func (e *Executor) ListTaskNames(allTasks bool)
- func (e *Executor) ListTasks(o ListOptions) (bool, error)
- func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error
- func (e *Executor) RunTask(ctx context.Context, call taskfile.Call) error
- func (e *Executor) Setup() error
- func (e *Executor) Status(ctx context.Context, calls ...taskfile.Call) error
- func (e *Executor) ToEditorOutput(tasks []*taskfile.Task) (*editors.Taskfile, error)
- type FilterFunc
- type ListOptions
Constants ¶
const ( // MaximumTaskCall is the max number of times a task can be called. // This exists to prevent infinite loops on cyclic dependencies MaximumTaskCall = 100 )
Variables ¶
var ErrPreconditionFailed = errors.New("task: precondition not met")
ErrPreconditionFailed is returned when a precondition fails
Functions ¶
func FilterOutInternal ¶ added in v3.18.0
FilterOutInternal removes all tasks that are marked as internal.
func FilterOutNoDesc ¶ added in v3.18.0
FilterOutNoDesc removes all tasks that do not contain a description.
Types ¶
type Executor ¶
type Executor struct {
Taskfile *taskfile.Taskfile
Dir string
TempDir string
Entrypoint string
Force bool
Watch bool
Verbose bool
Silent bool
Dry bool
Summary bool
Parallel bool
Color bool
Concurrency int
Interval time.Duration
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Logger *logger.Logger
Compiler compiler.Compiler
Output output.Output
OutputStyle taskfile.Output
TaskSorter sort.TaskSorter
// contains filtered or unexported fields
}
Executor executes a Taskfile
func (*Executor) CompiledTask ¶
CompiledTask returns a copy of a task, but replacing variables in almost all properties using the Go template package.
func (*Executor) FastCompiledTask ¶ added in v3.2.2
FastCompiledTask is like CompiledTask, but it skippes dynamic variables.
func (*Executor) GetTask ¶ added in v3.17.0
GetTask will return the task with the name matching the given call from the taskfile. If no task is found, it will search for tasks with a matching alias. If multiple tasks contain the same alias or no matches are found an error is returned.
func (*Executor) GetTaskList ¶ added in v3.18.0
func (e *Executor) GetTaskList(filters ...FilterFunc) ([]*taskfile.Task, error)
func (*Executor) InterceptInterruptSignals ¶ added in v3.13.0
func (e *Executor) InterceptInterruptSignals()
NOTE(@andreynering): This function intercepts SIGINT and SIGTERM signals so the Task process is not killed immediately and processes running have time to do cleanup work.
func (*Executor) ListTaskNames ¶ added in v3.12.0
ListTaskNames prints only the task names in a Taskfile. Only tasks with a non-empty description are printed if allTasks is false. Otherwise, all task names are printed.
func (*Executor) ListTasks ¶ added in v3.18.0
func (e *Executor) ListTasks(o ListOptions) (bool, error)
ListTasks prints a list of tasks. Tasks that match the given filters will be excluded from the list. The function returns a boolean indicating whether tasks were found and an error if one was encountered while preparing the output.
type FilterFunc ¶ added in v3.18.0
type ListOptions ¶ added in v3.19.1
type ListOptions struct {
ListOnlyTasksWithDescriptions bool
ListAllTasks bool
FormatTaskListAsJSON bool
}
ListOptions collects list-related options
func NewListOptions ¶ added in v3.19.1
func NewListOptions(list, listAll, listAsJson bool) ListOptions
NewListOptions creates a new ListOptions instance
func (ListOptions) Filters ¶ added in v3.19.1
func (o ListOptions) Filters() []FilterFunc
Filters returns the slice of FilterFunc which filters a list of taskfile.Task according to the given ListOptions
func (ListOptions) ShouldListTasks ¶ added in v3.19.1
func (o ListOptions) ShouldListTasks() bool
ShouldListTasks returns true if one of the options to list tasks has been set to true
func (ListOptions) Validate ¶ added in v3.19.1
func (o ListOptions) Validate() error
Validate validates that the collection of list-related options are in a valid configuration