mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 13:57:26 -08:00
parent
016dc50e72
commit
dee6d18baf
|
@ -82,6 +82,9 @@ func (t *Text) cleanTemplate() {
|
|||
}
|
||||
|
||||
knownVariable := func(variable string) bool {
|
||||
if variable == "." {
|
||||
return true
|
||||
}
|
||||
variable = strings.TrimPrefix(variable, ".")
|
||||
splitted := strings.Split(variable, ".")
|
||||
if len(splitted) == 0 {
|
||||
|
|
|
@ -225,6 +225,11 @@ func TestCleanTemplate(t *testing.T) {
|
|||
Expected string
|
||||
Template string
|
||||
}{
|
||||
{
|
||||
Case: "Literal dot",
|
||||
Expected: "hello . what's up",
|
||||
Template: "hello . what's up",
|
||||
},
|
||||
{
|
||||
Case: "Variable",
|
||||
Expected: "{{range $cpu := .Data.CPU}}{{round $cpu.Mhz 2 }} {{end}}",
|
||||
|
|
Loading…
Reference in a new issue