Skip to content

Commit

Permalink
Add Windows-friendly alternative for our checkup status emojis (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Nov 26, 2024
1 parent b5ebe99 commit 5b85275
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
17 changes: 0 additions & 17 deletions ee/debug/checkups/checkups.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ const (
Failing Status = "Failing" // Checkup is failing
)

func (s Status) Emoji() string {
switch s {
case Informational:
return " "
case Passing:
return "✅"
case Warning:
return "⚠️"
case Failing:
return "❌"
case Erroring:
return "❌"
default:
return "? "
}
}

func writeSummary(w io.Writer, s Status, name, msg string) {
fmt.Fprintf(w, "%s\t%s: %s\n", s.Emoji(), name, msg)
}
Expand Down
21 changes: 21 additions & 0 deletions ee/debug/checkups/checkups_other.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build !windows
// +build !windows

package checkups

func (s Status) Emoji() string {
switch s {
case Informational:
return " "
case Passing:
return "✅"
case Warning:
return "⚠️"
case Failing:
return "❌"
case Erroring:
return "❌"
default:
return "? "
}
}
23 changes: 23 additions & 0 deletions ee/debug/checkups/checkups_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//go:build windows
// +build windows

package checkups

// Emoji returns the Windows-friendly symbol for the given status. Powershell will not
// display actual emojis.
func (s Status) Emoji() string {
switch s {
case Informational:
return " "
case Passing:
return "OK "
case Warning:
return "! "
case Failing:
return "X "
case Erroring:
return "X "
default:
return "? "
}
}

0 comments on commit 5b85275

Please sign in to comment.