Skip to content

Commit

Permalink
Configure status emojies
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Aug 17, 2020
1 parent 47669f7 commit 7047d78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions renderers/config/interactive_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ type InteractiveRendererConfig struct {
RefreshRate time.Duration
ProgressIndicatorFrames []string
ProgressIndicatorCycleDuration time.Duration
SuccessStatus string
FailureStatus string
}

func NewDefaultRenderingConfig() *InteractiveRendererConfig {
Expand All @@ -20,6 +22,8 @@ func NewDefaultRenderingConfig() *InteractiveRendererConfig {
"🕐", "🕑", "🕒", "🕓", "🕔", "🕕", "🕖", "🕗", "🕘", "🕙", "🕚", "🕛",
},
ProgressIndicatorCycleDuration: time.Second,
SuccessStatus: "✅",
FailureStatus: "❌",
}
}

Expand Down
6 changes: 2 additions & 4 deletions renderers/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ func (r *InteractiveRenderer) RenderScopeFinished(entry *echelon.LogScopeFinishe
n.ClearAllChildren()
n.ClearDescription()
}
// for some reason ✅ eats a space when displayed in terminal after it so let's add an extra space
n.CompleteWithColor("✅ ", r.config.Colors.SuccessColor)
n.CompleteWithColor(r.config.SuccessStatus, r.config.Colors.SuccessColor)
} else {
// for some reason ❌ eats a space when displayed in terminal after it so let's add an extra space
n.CompleteWithColor("❌ ", r.config.Colors.FailureColor)
n.CompleteWithColor(r.config.FailureStatus, r.config.Colors.FailureColor)
}
}

Expand Down

0 comments on commit 7047d78

Please sign in to comment.