-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Windows-friendly alternative for our checkup status emojis (#1970)
- Loading branch information
1 parent
b5ebe99
commit 5b85275
Showing
3 changed files
with
44 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "? " | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "? " | ||
} | ||
} |