mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
parent
c105294f61
commit
c1f9f73184
@ -14,6 +14,7 @@ import (
|
||||
"github.com/go-task/task/execext"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/Masterminds/sprig"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@ -76,10 +77,19 @@ func (t *Task) handleVariables() (map[string]string, error) {
|
||||
return localVariables, nil
|
||||
}
|
||||
|
||||
var templateFuncs = template.FuncMap{
|
||||
"OS": func() string { return runtime.GOOS },
|
||||
"ARCH": func() string { return runtime.GOARCH },
|
||||
"IsSH": func() bool { return execext.ShExists },
|
||||
var templateFuncs template.FuncMap
|
||||
|
||||
func init() {
|
||||
taskFuncs := template.FuncMap{
|
||||
"OS": func() string { return runtime.GOOS },
|
||||
"ARCH": func() string { return runtime.GOARCH },
|
||||
"IsSH": func() bool { return execext.ShExists },
|
||||
}
|
||||
|
||||
templateFuncs = sprig.TxtFuncMap()
|
||||
for k, v := range taskFuncs {
|
||||
templateFuncs[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// ReplaceVariables writes vars into initial string
|
||||
|
Loading…
x
Reference in New Issue
Block a user