mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:56:45 +08:00
implement pr and issues browse
This commit is contained in:
1 parent
0c405b495f
commit
e2cc0e1006
3 files changed
+42
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package browse
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/daveberrys/guh/src/utils"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/pkg/browser"
|
||||
)
|
||||
|
||||
var prCmd = &cobra.Command{
|
||||
Use: "pr",
|
||||
Short: "Opens a browser to the PRs page.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
url, err := utils.RunGit(true, "remote", "get-url", "origin")
|
||||
if err != nil { return err }
|
||||
url = strings.TrimSuffix(url, ".git")
|
||||
return browser.OpenURL(url + "/pulls")
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user