Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into help-wanted-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Oct 13, 2020
2 parents bb6a571 + f87b684 commit 3d734a5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ GitHub CLI is available for repositories hosted on GitHub.com and GitHub Enterpr

## Contributing

If anything feels off, or if you feel that some functionality is missing, please check out the [contributing page][contributing]. We'd love to hear your feedback!
If anything feels off, or if you feel that some functionality is missing, please check out the [contributing page][contributing].


<!-- this anchor is linked to from elsewhere, so avoid renaming it -->
## Installation

### macOS

`gh` is available via [Homebrew][] and [MacPorts][].
`gh` is available via [Homebrew][], [MacPorts][], and as a downloadable binary from the [releases page][].

#### Homebrew

|Install:|Upgrade:|
|---|---|
|`brew install gh`|`brew upgrade gh`|
| Install: | Upgrade: |
| ----------------- | ----------------- |
| `brew install gh` | `brew upgrade gh` |

#### MacPorts

|Install:|Upgrade:|
|---|---|
|`sudo port install gh`|`sudo port selfupdate && sudo port upgrade gh`|


| Install: | Upgrade: |
| ---------------------- | ---------------------------------------------- |
| `sudo port install gh` | `sudo port selfupdate && sudo port upgrade gh` |

### Linux

See [Linux installation docs](./docs/install_linux.md).
`gh` is available via [Homebrew](#homebrew), and as downloadable binaries from the [releases page][].

For more information and distro-specific instructions, see the [Linux installation docs](./docs/install_linux.md).

### Windows

Expand All @@ -61,10 +61,9 @@ scoop update gh

#### Chocolatey

|Install:|Upgrade:|
|---|---|
|`choco install gh`|`choco upgrade gh`|

| Install: | Upgrade: |
| ------------------ | ------------------ |
| `choco install gh` | `choco upgrade gh` |

#### Signed MSI

Expand Down
1 change: 0 additions & 1 deletion api/queries_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type IssuesAndTotalCount struct {
TotalCount int
}

// Ref. https://developer.github.com/v4/object/issue/
type Issue struct {
ID string
Number int
Expand Down
12 changes: 11 additions & 1 deletion cmd/gh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,17 @@ func printError(out io.Writer, err error, cmd *cobra.Command, debug bool) {
}

func shouldCheckForUpdate() bool {
return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr)
if os.Getenv("GH_NO_UPDATE_NOTIFIER") != "" {
return false
}
return updaterEnabled != "" && !isCI() && !isCompletionCommand() && utils.IsTerminal(os.Stderr)
}

// based on https://github.com/watson/ci-info/blob/HEAD/index.js
func isCI() bool {
return os.Getenv("CI") != "" || // GitHub Actions, Travis CI, CircleCI, Cirrus CI, GitLab CI, AppVeyor, CodeShip, dsari
os.Getenv("BUILD_NUMBER") != "" || // Jenkins, TeamCity
os.Getenv("RUN_ID") != "" // TaskCluster, dsari
}

func isCompletionCommand() bool {
Expand Down
2 changes: 0 additions & 2 deletions pkg/cmd/pr/view/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ func printHumanPrPreview(io *iostreams.IOStreams, pr *api.PullRequest) error {
return nil
}

// Ref. https://developer.github.com/v4/enum/pullrequestreviewstate/
const (
requestedReviewState = "REQUESTED" // This is our own state for review request
approvedReviewState = "APPROVED"
Expand Down Expand Up @@ -250,7 +249,6 @@ func prReviewerList(pr api.PullRequest) string {
return reviewerList
}

// Ref. https://developer.github.com/v4/union/requestedreviewer/
const teamTypeName = "Team"

const ghostName = "ghost"
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/root/help_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func NewHelpTopic(topic string) *cobra.Command {
CLICOLOR_FORCE: set to a value other than "0" to keep ANSI colors in output
even when the output is piped.
GH_NO_UPDATE_NOTIFIER: set to any value to disable update notifications. By default, gh
checks for new releases once every 24 hours and displays an upgrade notice on standard
error if a newer version was found.
`)

cmd := &cobra.Command{
Expand Down

0 comments on commit 3d734a5

Please sign in to comment.