mirror of
https://github.com/go-task/task.git
synced 2025-11-29 22:48:03 +02:00
Add shellQuote template function
This commit is contained in:
@@ -6,7 +6,8 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/go-task/slim-sprig"
|
||||
sprig "github.com/go-task/slim-sprig"
|
||||
"mvdan.cc/sh/v3/syntax"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -37,6 +38,9 @@ func init() {
|
||||
}
|
||||
return ""
|
||||
},
|
||||
"shellQuote": func(str string) (string, error) {
|
||||
return syntax.Quote(str, syntax.LangBash)
|
||||
},
|
||||
// IsSH is deprecated.
|
||||
"IsSH": func() bool { return true },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user