Skip to content

Commit

Permalink
feat(open): add output for open action (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 authored Sep 13, 2024
1 parent 1f790ba commit fe59cbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/actions/open/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Package open implements an [actions.Runner] that opens a notification in the bro
package open

import (
"fmt"
"io"
"log/slog"

"github.com/cli/go-gh/pkg/browser"
"github.com/nobe4/gh-not/internal/colors"
"github.com/nobe4/gh-not/internal/gh"
"github.com/nobe4/gh-not/internal/notifications"
)
Expand All @@ -20,5 +22,9 @@ func (a *Runner) Run(n *notifications.Notification, w io.Writer) error {
slog.Debug("open notification in browser", "notification", n)

browser := browser.New("", w, w)
return browser.Browse(n.Subject.HtmlUrl)

err := browser.Browse(n.Subject.HtmlUrl)
fmt.Fprint(w, colors.Blue("OPEN ")+n.Subject.URL)

return err
}

0 comments on commit fe59cbf

Please sign in to comment.