go-selfupdate

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2020 License: MIT

README

Self-Update library for GitHub hosted applications in Go

Godoc reference Build Status codecov

go-selfupdate detects the information of the latest release via GitHub Releases API and checks the current version. If a newer version than itself is detected, it downloads the released binary from GitHub and replaces itself.

  • Automatically detect the latest version of released binary on GitHub
  • Retrieve the proper binary for the OS and arch where the binary is running
  • Update the binary with rollback support on failure
  • Tested on Linux, macOS and Windows
  • Many archive and compression formats are supported (zip, tar, gzip, xzip, bzip2)
  • Support private repositories
  • Support hash, signature validation

This library started as a fork of https://github.com/rhysd/go-github-selfupdate. A few things have changed from the original implementation:

  • don't expose an external semver.Version type, but provide the same functionality through the API: LessThan, Equal and GreaterThan
  • use an interface to send logs (compatible with standard log.Logger)
  • able to detect different ARM CPU architectures (the original library wasn't working on my bakery of raspberry pi)
  • support for assets compressed with bzip2 (.bz2)

Directories

Path Synopsis
cmd
go-get-release command
Package selfupdate provides self-update mechanism to Go command line tools.
Package selfupdate provides self-update mechanism to Go command line tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL