Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows-friendly alternative for our checkup status emojis #1970

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 "? "
}
}
Loading