mirror of
https://github.com/go-task/task.git
synced 2025-06-27 00:51:05 +02:00
@ -7,6 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
@ -84,6 +85,18 @@ func init() {
|
|||||||
"OS": func() string { return runtime.GOOS },
|
"OS": func() string { return runtime.GOOS },
|
||||||
"ARCH": func() string { return runtime.GOARCH },
|
"ARCH": func() string { return runtime.GOARCH },
|
||||||
"IsSH": func() bool { return execext.ShExists },
|
"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()
|
templateFuncs = sprig.TxtFuncMap()
|
||||||
|
Reference in New Issue
Block a user