From 4326fe496455c65cf01f045aa1044b2239d44f35 Mon Sep 17 00:00:00 2001 From: Ryan Garant Date: Sat, 14 Sep 2019 17:34:22 -0700 Subject: [PATCH] fix(pull-request): show PR table formatting by default --- README.md | 2 +- default.gh.json | 2 +- package-lock.json | 2 +- src/cmds/pull-request.ts | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7bdac4f2..98fe806e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/default.gh.json b/default.gh.json index 077571f5..d8b373bd 100644 --- a/default.gh.json +++ b/default.gh.json @@ -103,7 +103,7 @@ "plugins": {}, - "pretty_print": false, + "pretty_print": true, "replace": {}, diff --git a/package-lock.json b/package-lock.json index 9f06390f..b4b2dd5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gh", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/cmds/pull-request.ts b/src/cmds/pull-request.ts index 2d9a7909..67055e1a 100755 --- a/src/cmds/pull-request.ts +++ b/src/cmds/pull-request.ts @@ -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)