1
0
mirror of https://github.com/go-task/task.git synced 2025-06-25 00:47:04 +02:00

Allow interpolation on "generates" and "sources" attributes

Closes #26
This commit is contained in:
Andrey Nering
2017-04-30 19:32:28 -03:00
parent 8b76911675
commit b269c6e162
2 changed files with 38 additions and 10 deletions

View File

@ -99,6 +99,19 @@ func init() {
}
}
// ReplaceSliceVariables writes vars into initial string slice
func (t *Task) ReplaceSliceVariables(initials []string) ([]string, error) {
result := make([]string, len(initials))
for i, s := range initials {
var err error
result[i], err = t.ReplaceVariables(s)
if err != nil {
return nil, err
}
}
return result, nil
}
// ReplaceVariables writes vars into initial string
func (t *Task) ReplaceVariables(initial string) (string, error) {
vars, err := t.getVariables()