mirror of
https://github.com/go-task/task.git
synced 2025-06-06 23:46:46 +02:00
better error output for dynamic variables in Taskvars.yml
This commit is contained in:
parent
645f77b849
commit
92ecb1c7ec
@ -52,3 +52,12 @@ type cantWatchNoSourcesError struct {
|
|||||||
func (err *cantWatchNoSourcesError) Error() string {
|
func (err *cantWatchNoSourcesError) Error() string {
|
||||||
return fmt.Sprintf(`task: Can't watch task "%s" because it has no specified sources`, err.taskName)
|
return fmt.Sprintf(`task: Can't watch task "%s" because it has no specified sources`, err.taskName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type dynamicVarError struct {
|
||||||
|
cause error
|
||||||
|
cmd string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (err *dynamicVarError) Error() string {
|
||||||
|
return fmt.Sprintf(`task: Command "%s" in taskvars file failed: %s`, err.cmd, err.cause)
|
||||||
|
}
|
||||||
|
@ -41,7 +41,7 @@ func (e *Executor) handleDynamicVariableContent(value string) (string, error) {
|
|||||||
Stderr: e.Stderr,
|
Stderr: e.Stderr,
|
||||||
}
|
}
|
||||||
if err := execext.RunCommand(opts); err != nil {
|
if err := execext.RunCommand(opts); err != nil {
|
||||||
return "", err
|
return "", &dynamicVarError{cause: err, cmd: opts.Command}
|
||||||
}
|
}
|
||||||
|
|
||||||
result := buff.String()
|
result := buff.String()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user