Skip to content

Commit a923339

Browse files
committed
add link to tag in commit header
Signed-off-by: jolheiser <[email protected]>
1 parent 27502f7 commit a923339

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

commit.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,18 @@ func printCommits(repo vcs.Repo) {
4949
Foreground(lipgloss.Color(theme.colorMagenta))
5050
// headerDimStyle := lipgloss.NewStyle().
5151
// Foreground(lipgloss.Color(dimColor))
52-
sinceTag := repo.LastRelease.TagName
53-
if sinceTag == "" {
54-
sinceTag = "creation"
52+
sinceTag := "creation"
53+
if repo.LastRelease.TagName != "" {
54+
sinceTag = repo.LastRelease.TagName
55+
if useLinks {
56+
sinceTag = termenv.Hyperlink(repo.LastRelease.URL, sinceTag)
57+
}
5558
}
59+
sinceTag = headerStyle.Render(sinceTag)
5660

57-
fmt.Printf("\n🔥 %s %s\n",
58-
headerStyle.Render(fmt.Sprintf("%s %s",
59-
pluralize(len(commits), "commit since", "commits since"),
60-
sinceTag)),
61-
61+
fmt.Printf("\n🔥 %s %s %s\n",
62+
headerStyle.Render(pluralize(len(commits), "commit since", "commits since")),
63+
sinceTag,
6264
headerStyle.Render(fmt.Sprintf("(%s)",
6365
humanize.Time(repo.LastRelease.PublishedAt))),
6466
)

0 commit comments

Comments
 (0)