mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
5b6cf08acc
commit
25fa43c1d3
|
@ -12,6 +12,8 @@ func funcMap() template.FuncMap {
|
|||
"url": url,
|
||||
"path": path,
|
||||
"glob": glob,
|
||||
"matchP": matchP,
|
||||
"replaceP": replaceP,
|
||||
}
|
||||
for key, fun := range sprig.TxtFuncMap() {
|
||||
if _, ok := funcMap[key]; !ok {
|
||||
|
|
11
src/template/regex.go
Normal file
11
src/template/regex.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package template
|
||||
|
||||
import "oh-my-posh/regex"
|
||||
|
||||
func matchP(pattern, text string) bool {
|
||||
return regex.MatchString(pattern, text)
|
||||
}
|
||||
|
||||
func replaceP(pattern, text, replaceText string) string {
|
||||
return regex.ReplaceAllString(pattern, text, replaceText)
|
||||
}
|
Loading…
Reference in a new issue