1
0
mirror of https://github.com/go-task/task.git synced 2025-11-27 22:38:20 +02:00

Improve nested variables support

Closes #76 #89 #77 #83
This commit is contained in:
Andrey Nering
2018-02-18 09:50:39 -03:00
parent 87a200e42c
commit 3556942516
14 changed files with 319 additions and 57 deletions

View File

@@ -122,7 +122,7 @@ func (c *CompilerV1) HandleDynamicVar(v taskfile.Var) (string, error) {
Stderr: c.Logger.Stderr,
}
if err := execext.RunCommand(opts); err != nil {
return "", &dynamicVarError{cause: err, cmd: opts.Command}
return "", fmt.Errorf(`task: Command "%s" in taskvars file failed: %s`, opts.Command, err)
}
// Trim a single trailing newline from the result to make most command
@@ -134,12 +134,3 @@ func (c *CompilerV1) HandleDynamicVar(v taskfile.Var) (string, error) {
return result, nil
}
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)
}