Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
fix(pull-request): show PR table formatting by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Garant committed Sep 15, 2019
1 parent e166317 commit 4326fe4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ gh pull-request
#### Examples

- **Shortcut** for listing open pull requests for the current repository.
- To pretty print output in a table add `"pretty_print": true` to your `~/.gh-json` config or to cli like `--prettyPrint`
- To turn off pretty printing of output in a table add `"pretty_print": false` to your `~/.gh-json` config

```
gh pr
Expand Down
2 changes: 1 addition & 1 deletion default.gh.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

"plugins": {},

"pretty_print": false,
"pretty_print": true,

"replace": {},

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/cmds/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,9 @@ PullRequest.prototype.list = async function(user, repo) {
json.branches.forEach((branch, index, arr) => {
logger.log(`${logger.colors.blue('Branch:')} ${branch.name} (${branch.total})`)

if (config.pretty_print || options.prettyPrint) {
const printTableView = config.pretty_print === undefined || Boolean(config.pretty_print)

if (printTableView) {
instance.printPullsInfoTable_(branch.pulls)
} else {
branch.pulls.forEach(instance.printPullInfo_, instance)
Expand Down

0 comments on commit 4326fe4

Please sign in to comment.