mirror of
https://github.com/go-task/task.git
synced 2025-01-22 05:10:17 +02:00
parent
c1f9f73184
commit
0d84549b2a
@ -7,6 +7,7 @@ import (
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"text/template"
|
||||
@ -84,6 +85,18 @@ func init() {
|
||||
"OS": func() string { return runtime.GOOS },
|
||||
"ARCH": func() string { return runtime.GOARCH },
|
||||
"IsSH": func() bool { return execext.ShExists },
|
||||
"FromSlash": func(path string) string {
|
||||
if execext.ShExists {
|
||||
return path
|
||||
}
|
||||
return filepath.FromSlash(path)
|
||||
},
|
||||
"ToSlash": func(path string) string {
|
||||
if execext.ShExists {
|
||||
return path
|
||||
}
|
||||
return filepath.ToSlash(path)
|
||||
},
|
||||
}
|
||||
|
||||
templateFuncs = sprig.TxtFuncMap()
|
||||
|
Loading…
x
Reference in New Issue
Block a user