mirror of
https://github.com/go-task/task.git
synced 2025-02-11 13:53:03 +02:00
Prefix all output messages from task with "task: "
This makes it easier to know if a message comes from task or from a command stdout or stderr
This commit is contained in:
parent
a9b8e31228
commit
576b18246a
@ -5,14 +5,14 @@ import (
|
||||
)
|
||||
|
||||
// ErrNoTaskFile is returned when the program can not find a proper TaskFile
|
||||
var ErrNoTaskFile = fmt.Errorf(`No task file found (is it named "%s"?)`, TaskFilePath)
|
||||
var ErrNoTaskFile = fmt.Errorf(`task: No task file found (is it named "%s"?)`, TaskFilePath)
|
||||
|
||||
type taskNotFoundError struct {
|
||||
taskName string
|
||||
}
|
||||
|
||||
func (err *taskNotFoundError) Error() string {
|
||||
return fmt.Sprintf(`Task "%s" not found`, err.taskName)
|
||||
return fmt.Sprintf(`task: Task "%s" not found`, err.taskName)
|
||||
}
|
||||
|
||||
type taskRunError struct {
|
||||
@ -21,7 +21,7 @@ type taskRunError struct {
|
||||
}
|
||||
|
||||
func (err *taskRunError) Error() string {
|
||||
return fmt.Sprintf(`Failed to run task "%s": %v`, err.taskName, err.err)
|
||||
return fmt.Sprintf(`task: Failed to run task "%s": %v`, err.taskName, err.err)
|
||||
}
|
||||
|
||||
type cyclicDepError struct {
|
||||
@ -29,5 +29,5 @@ type cyclicDepError struct {
|
||||
}
|
||||
|
||||
func (err *cyclicDepError) Error() string {
|
||||
return fmt.Sprintf(`Cyclic dependency of task "%s" detected`, err.taskName)
|
||||
return fmt.Sprintf(`task: Cyclic dependency of task "%s" detected`, err.taskName)
|
||||
}
|
||||
|
4
task.go
4
task.go
@ -53,7 +53,7 @@ func Run() {
|
||||
|
||||
args := pflag.Args()
|
||||
if len(args) == 0 {
|
||||
log.Fatal("No argument given")
|
||||
log.Fatal("task: No argument given")
|
||||
}
|
||||
|
||||
var err error
|
||||
@ -88,7 +88,7 @@ func RunTask(name string) error {
|
||||
}
|
||||
|
||||
if !Force && isTaskUpToDate(t) {
|
||||
log.Printf(`Task "%s" is up to date`, name)
|
||||
log.Printf(`task: Task "%s" is up to date`, name)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user