Skip to content

Commit

Permalink
Disable colored gh outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
seachicken committed Nov 12, 2022
1 parent f3d771a commit ac6ecf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions conn/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ func (conn *Connection) GetSshConfig(ctx context.Context, name string) (string,
func (conn *Connection) GetRepoNames(ctx context.Context, hostname string, repoName string) (string, error) {
args := []string{
"repo", "view", hostname + "/" + repoName,
"--json", "owner",
"--json", "name",
"--json", "parent",
"--json", "defaultBranchRef",
"--json", "owner,name,parent,defaultBranchRef",
// disable colored outputs (https://github.com/seachicken/gh-poi/issues/79)
"--jq", ".",
}
return conn.run(ctx, "gh", args, None)
}
Expand Down Expand Up @@ -101,6 +100,7 @@ func (conn *Connection) GetPullRequests(
args := []string{
"api", "graphql",
"--hostname", hostname,
"--jq", ".",
"-f", fmt.Sprintf(`query=query {
search(type: ISSUE, query: "is:pr %s %s", last: 100) {
issueCount
Expand Down
6 changes: 4 additions & 2 deletions poi.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ func GetBranches(ctx context.Context, remote Remote, connection Connection, dryR
return nil, err
}

if pr, err := toPullRequests(json); err == nil {
prs = append(prs, pr...)
pr, err := toPullRequests(json)
if err != nil {
return nil, err
}
prs = append(prs, pr...)
}

branches = applyPullRequest(ctx, branches, prs, connection)
Expand Down

0 comments on commit ac6ecf1

Please sign in to comment.