@@ -55,18 +55,18 @@ func init() {
5555 [ attached pull request to issue #123 ]
5656*/
5757func pullRequest (cmd * Command , args * Args ) {
58- var (
59- title , body string
60- err error
61- )
58+ var title , body string
6259 if args .ParamsSize () == 1 {
6360 title = args .RemoveParam (0 )
6461 }
6562
6663 gh := github .New ()
6764 repo := gh .Project .LocalRepoWith (flagPullRequestBase , flagPullRequestHead )
6865 if title == "" && flagPullRequestIssue == "" {
69- title , body , err = writePullRequestTitleAndBody (repo )
66+ t , b , err := writePullRequestTitleAndBody (repo )
67+ utils .Check (err )
68+ title = t
69+ body = b
7070 }
7171
7272 if title == "" && flagPullRequestIssue == "" {
@@ -79,14 +79,16 @@ func pullRequest(cmd *Command, args *Args) {
7979 pullRequestURL = "PULL_REQUEST_URL"
8080 } else {
8181 if title != "" {
82- pullRequestURL , err = gh .CreatePullRequest (repo .Base , repo .Head , title , body )
82+ pr , err := gh .CreatePullRequest (repo .Base , repo .Head , title , body )
83+ utils .Check (err )
84+ pullRequestURL = pr .HTMLURL
8385 }
84- utils .Check (err )
8586
8687 if flagPullRequestIssue != "" {
87- pullRequestURL , err = gh .CreatePullRequestForIssue (repo .Base , repo .Head , flagPullRequestIssue )
88+ pr , err := gh .CreatePullRequestForIssue (repo .Base , repo .Head , flagPullRequestIssue )
89+ utils .Check (err )
90+ pullRequestURL = pr .HTMLURL
8891 }
89- utils .Check (err )
9092 }
9193
9294 args .Replace ("echo" , "" , pullRequestURL )
0 commit comments