Skip to content

Commit

Permalink
add no color option for release notes (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir committed Apr 24, 2024
1 parent 5f52f8b commit 8bfb6fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
var (
// By default when tool is updated release notes of latest version are printed
HideReleaseNotes = false
NoColorReleaseNotes = false
HideProgressBar = false
VersionCheckTimeout = time.Duration(5) * time.Second
DownloadUpdateTimeout = time.Duration(30) * time.Second
Expand Down Expand Up @@ -90,8 +91,12 @@ func GetUpdateToolFromRepoCallback(toolName, version, repoName string) func() {

if !HideReleaseNotes {
output := gh.Latest.GetBody()
// adjust colors for both dark / light terminal themes
r, err := glamour.NewTermRenderer(glamour.WithAutoStyle())

style := glamour.WithAutoStyle()
if NoColorReleaseNotes {
style = glamour.WithStyles(glamour.ASCIIStyleConfig)
}
r, err := glamour.NewTermRenderer(style)
if err != nil {
gologger.Error().Msgf("markdown rendering not supported: %v", err)
}
Expand Down

0 comments on commit 8bfb6fd

Please sign in to comment.