Merge pull request #22 from flowonyx/patch-2

Corrected some typos in README
This commit is contained in:
Linda_pp 2019-10-30 12:39:08 +09:00 committed by GitHub
commit 80762b859d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 19 deletions

View File

@ -1,4 +1,4 @@
Self-Update Mechanism for Go Commands using GitHub Self-Update Mechanism for Go Commands Using GitHub
================================================== ==================================================
[![GoDoc Badge][]][GoDoc] [![GoDoc Badge][]][GoDoc]
@ -6,23 +6,23 @@ Self-Update Mechanism for Go Commands using GitHub
[![AppVeyor Status][]][AppVeyor] [![AppVeyor Status][]][AppVeyor]
[![Codecov Status][]][Codecov] [![Codecov Status][]][Codecov]
[go-github-selfupdate][] is a Go library to provide self-update mechanism to command line tools. [go-github-selfupdate][] is a Go library to provide a self-update mechanism to command line tools.
Go does not provide the way to install/update the stable version of tools. By default, Go command line Go does not provide a way to install/update the stable version of tools. By default, Go command line
tools are updated: tools are updated:
1. using `go get -u`, but it is not stable because HEAD of the repository is built 1. using `go get -u`, but it is not stable because HEAD of the repository is built
2. using system's package manager, but it is harder to release because of depending on the platform 2. using system's package manager, but it is harder to release because of depending on the platform
3. downloading executables from GitHub release page, but it requires users to download and put it manually 3. downloading executables from GitHub release page, but it requires users to download and put it in an executable path manually
[go-github-selfupdate][] resolves the problem of 3. by detecting the latest release, downloading it and [go-github-selfupdate][] resolves the problem of 3 by detecting the latest release, downloading it and
putting it to `$GOPATH/bin` automatically. putting it in `$GOPATH/bin` automatically.
[go-github-selfupdate][] detects the information of the latest release via [GitHub Releases API][] and [go-github-selfupdate][] detects the information of the latest release via [GitHub Releases API][] and
checks the current version. If newer version than itself is detected, it downloads released binary from checks the current version. If a newer version than itself is detected, it downloads the released binary from
GitHub and replaces itself. GitHub and replaces itself.
- Automatically detects the latest version of released binary on GitHub - Automatically detect the latest version of released binary on GitHub
- Retrieve the proper binary for the OS and arch where the binary is running - Retrieve the proper binary for the OS and arch where the binary is running
- Update the binary with rollback support on failure - Update the binary with rollback support on failure
- Tested on Linux, macOS and Windows (using Travis CI and AppVeyor) - Tested on Linux, macOS and Windows (using Travis CI and AppVeyor)
@ -67,7 +67,7 @@ Then run `-selfupdate`
$ selfupdate-example -selfupdate $ selfupdate-example -selfupdate
``` ```
It should replace itself and finally shows a message containing release notes. It should replace itself and finally show a message containing release notes.
Please check the binary version is updated to `v1.2.4` with `-version`. The binary is up-to-date. Please check the binary version is updated to `v1.2.4` with `-version`. The binary is up-to-date.
So running `-selfupdate` again only shows 'Current binary is the latest version'. So running `-selfupdate` again only shows 'Current binary is the latest version'.
@ -187,7 +187,7 @@ please use `os.Executable()`.
Please see [the documentation page][GoDoc] for more detail. Please see [the documentation page][GoDoc] for more detail.
This library should work with [GitHub Enterprise][]. To configure API base URL, please setup `Updater` This library should work with [GitHub Enterprise][]. To configure API base URL, please setup `Updater`
instance and use its method instead (Actually all functions above are just a shortcuts of methods of instance and use its methods instead (actually all functions above are just a shortcuts of methods of an
`Updater` instance). `Updater` instance).
Following is an example of usage with GitHub Enterprise. Following is an example of usage with GitHub Enterprise.
@ -226,8 +226,8 @@ If `APIToken` field is not given, it tries to retrieve API token from `[token]`
or `$GITHUB_TOKEN` environment variable. If no token is found, it raises an error because GitHub Enterprise or `$GITHUB_TOKEN` environment variable. If no token is found, it raises an error because GitHub Enterprise
API does not work without authentication. API does not work without authentication.
If your GitHub Enterprise instance's upload URL is different from the base URL, please also set `EnterpriseUploadURL` If your GitHub Enterprise instance's upload URL is different from the base URL, please also set the `EnterpriseUploadURL`
field field.
### Naming Rules of Released Binaries ### Naming Rules of Released Binaries
@ -307,9 +307,6 @@ In summary, structure of releases on GitHub looks like:
- ... (Other binaries for v1.1.3) - ... (Other binaries for v1.1.3)
- ... (older versions) - ... (older versions)
Tags which don't contain a version number are ignored (i.e. `nightly`). And releases marked
as `pre-release` are also ignored.
### Hash or Signature Validation ### Hash or Signature Validation
@ -370,7 +367,7 @@ $ export GITHUB_TOKEN="{token generated by you}"
$ go test -v ./selfupdate $ go test -v ./selfupdate
``` ```
Above command run almost all tests and it's enough to check the behavior before creating a pull request. The above command runs almost all tests and it's enough to check the behavior before creating a pull request.
Some tests are still not tested because they depend on my personal API access token, though; for repositories Some tests are still not tested because they depend on my personal API access token, though; for repositories
on GitHub Enterprise or private repositories on GitHub. on GitHub Enterprise or private repositories on GitHub.
@ -378,7 +375,7 @@ on GitHub Enterprise or private repositories on GitHub.
### Debugging ### Debugging
This library can output logs for debugging. By default, logger is disabled. This library can output logs for debugging. By default, logger is disabled.
You can enable the logger by following and can know the details of the self update. You can enable the logger by the following and can know the details of the self update.
```go ```go
selfupdate.EnableLog() selfupdate.EnableLog()
@ -388,7 +385,7 @@ selfupdate.EnableLog()
### CI ### CI
Tests run on CIs (Travis CI, Appveyor) are run with the token I generated. However, because of security Tests run on CIs (Travis CI, Appveyor) are run with the token I generated. However, because of security
reason, it is not used for the tests for pull requests. In the tests, a GitHub API token is not set and reasons, it is not used for the tests for pull requests. In the tests, a GitHub API token is not set and
API rate limit is often exceeding. So please ignore the test failures on creating a pull request. API rate limit is often exceeding. So please ignore the test failures on creating a pull request.
@ -418,7 +415,7 @@ This library utilizes
## What is different from [tj/go-update][]? ## What is different from [tj/go-update][]?
This library goal is the same as tj/go-update, but it's different in following points. This library's goal is the same as tj/go-update, but it's different in following points.
tj/go-update: tj/go-update: