mirror of
https://github.com/MedzikUser/go-github-selfupdate.git
synced 2024-08-15 03:25:29 +00:00
enable to use .gzip for releases
This commit is contained in:
parent
6fe53791b2
commit
231184f71b
2 changed files with 4 additions and 3 deletions
|
@ -12,12 +12,13 @@ const version = "1.2.3"
|
|||
|
||||
func selfUpdate() error {
|
||||
selfupdate.EnableLog()
|
||||
latest, err := selfupdate.TryUpdate(version, "go-github-selfupdate", nil)
|
||||
|
||||
previous := semver.Make(version)
|
||||
latest, err := selfupdate.TryUpdate(previous, "go-github-selfupdate", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
previous := semver.Make(version)
|
||||
if previous.Equals(latest.Version) {
|
||||
fmt.Println("Current binary is the latest version", version)
|
||||
} else {
|
||||
|
|
|
@ -25,7 +25,7 @@ func findSuitableReleaseAndAsset(rels []*github.RepositoryRelease) (*github.Repo
|
|||
// Generate candidates
|
||||
cs := make([]string, 0, 8)
|
||||
for _, sep := range []rune{'_', '-'} {
|
||||
for _, ext := range []string{".zip", ".tar.gz", ""} {
|
||||
for _, ext := range []string{".zip", ".tar.gz", ".gzip", ""} {
|
||||
suffix := fmt.Sprintf("%s%c%s%s", runtime.GOOS, sep, runtime.GOARCH, ext)
|
||||
cs = append(cs, suffix)
|
||||
if runtime.GOOS == "windows" {
|
||||
|
|
Loading…
Reference in a new issue