Skip to content

Commit

Permalink
render theme update
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Apr 19, 2023
1 parent 155be0f commit 0559a7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions update/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type Tool struct {
func GetVersionDescription(current string, latest string) string {
currentVer, _ := semver.NewVersion(current)
latestVer, _ := semver.NewVersion(latest)
if strings.Contains(current, "dev") {
return fmt.Sprintf("(%v)", aurora.BrightBlue("dev"))
if strings.HasSuffix(current, "-dev") {
return fmt.Sprintf("(%v)", aurora.Blue("development"))
}
if currentVer == nil || latestVer == nil {
// fallback to naive comparison
Expand Down
7 changes: 6 additions & 1 deletion update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ func GetUpdateToolFromRepoCallback(toolName, version, repoName string) func() {

if !HideReleaseNotes {
output := gh.Latest.GetBody()
if rendered, err := glamour.Render(output, "dark"); err == nil {
// adjust colors for both dark / light terminal themes
r, err := glamour.NewTermRenderer(glamour.WithAutoStyle())
if err != nil {
gologger.Error().Msgf("markdown rendering not supported: %v", err)
}
if rendered, err := r.Render(output); err == nil {
output = rendered
} else {
gologger.Error().Msg(err.Error())
Expand Down

0 comments on commit 0559a7d

Please sign in to comment.