https://github.com/metal-stack/updater
Updater is a small utility to update your go executables from a http server
https://github.com/metal-stack/updater
checksum cli golang updater
Last synced: 9 months ago
JSON representation
Updater is a small utility to update your go executables from a http server
- Host: GitHub
- URL: https://github.com/metal-stack/updater
- Owner: metal-stack
- Created: 2019-09-05T09:16:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T11:25:48.000Z (over 1 year ago)
- Last Synced: 2025-04-06T16:49:29.922Z (9 months ago)
- Topics: checksum, cli, golang, updater
- Language: Go
- Size: 50.8 KB
- Stars: 3
- Watchers: 6
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Updater
CLI´s get widely used. Updating them for various OSes is a pain. The common approach is to add a README.md on the project website an tell the user how to download and install that binary on his local machine.
Updater will do that for the user with a simple command.
It will download the binary from github releases.
Example usage:
```go
package main
import (
"github.com/metal-stack/updater"
"github.com/spf13/cobra"
)
const (
programName = "mybinary"
owner = "my-github-organisation"
repo = "my-cli"
)
var (
updateCmd = &cobra.Command{
Use: "update",
Short: "update the program",
}
updateCheckCmd = &cobra.Command{
Use: "check",
Short: "check for update of the program",
RunE: func(cmd *cobra.Command, args []string) error {
u, err := updater.New(owner, repo, programName)
if err != nil {
return err
}
return u.Check()
},
}
updateDoCmd = &cobra.Command{
Use: "do",
Short: "do the update of the program",
RunE: func(cmd *cobra.Command, args []string) error {
u, err := updater.New(owner, repo, programName)
if err != nil {
return err
}
return u.Do()
},
}
)
```