mirror of
https://github.com/go-task/task.git
synced 2025-06-17 00:17:51 +02:00
feat(prompts): add ability for tasks to prompt user pre execution (#1163)
This commit is contained in:
@ -89,7 +89,7 @@ type TaskCalledTooManyTimesError struct {
|
||||
|
||||
func (err *TaskCalledTooManyTimesError) Error() string {
|
||||
return fmt.Sprintf(
|
||||
`task: maximum task call exceeded (%d) for task %q: probably an cyclic dep or infinite loop`,
|
||||
`task: Maximum task call exceeded (%d) for task %q: probably an cyclic dep or infinite loop`,
|
||||
err.MaximumTaskCall,
|
||||
err.TaskName,
|
||||
)
|
||||
@ -98,3 +98,19 @@ func (err *TaskCalledTooManyTimesError) Error() string {
|
||||
func (err *TaskCalledTooManyTimesError) Code() int {
|
||||
return CodeTaskCalledTooManyTimes
|
||||
}
|
||||
|
||||
// TaskCancelledError is returned when the user does not accept an optional prompt to continue.
|
||||
type TaskCancelledError struct {
|
||||
TaskName string
|
||||
}
|
||||
|
||||
func (err *TaskCancelledError) Error() string {
|
||||
return fmt.Sprintf(
|
||||
`task: %q Cancelled by user`,
|
||||
err.TaskName,
|
||||
)
|
||||
}
|
||||
|
||||
func (err *TaskCancelledError) Code() int {
|
||||
return CodeTaskCancelled
|
||||
}
|
||||
|
Reference in New Issue
Block a user