Skip to content

Commit

Permalink
add documentation in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Jun 16, 2024
1 parent 45a3c44 commit 53a7583
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Self-Update library for Github, Gitea and Gitlab hosted applications in Go
* [SHA256](#sha256)
* [ECDSA](#ecdsa)
* [Using a single checksum file for all your assets](#using-a-single-checksum-file-for-all-your-assets)
* [macOS universal binaries](#macos-universal-binaries)
* [Other providers than Github](#other-providers-than-github)
* [GitLab](#gitlab)
* [Example:](#example-1)
Expand All @@ -43,9 +44,9 @@ the source provider and replaces itself.
- 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
- Support for different versions of ARM architectures
- Support for different versions of ARM architecture
- Support macOS universal binaries
- Many archive and compression formats are supported (zip, tar, gzip, xzip, bzip2)
- Many archive and compression formats are supported (zip, tar, gzip, xz, bzip2)
- Support private repositories
- Support hash, signature validation

Expand Down Expand Up @@ -303,6 +304,18 @@ Tools like [goreleaser][] produce a single checksum file for all your assets. A
updater, _ := NewUpdater(Config{Validator: &ChecksumValidator{UniqueFilename: "checksums.txt"}})
```

# macOS universal binaries

You can ask the updater to choose a macOS universal binary as a fallback if the native architecture wasn't found.

You need to provide the architecture name for the universal binary in the `Config` struct:

```go
updater, _ := NewUpdater(Config{UniversalArch: "all"})
```

Default is empty, which means no fallback.

# Other providers than Github

This library can be easily extended by providing a new source and release implementation for any git provider
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Config struct {
// Arm 32bits version. Valid values are 0 (unknown), 5, 6 or 7. Default is detected value (if available).
Arm uint8
// Arch name for macOS universal binary. Default to none.
// If set, the updater will only pick the universal binary if the Arch is not found.
UniversalArch string
// Draft permits an upgrade to a "draft" version (default to false).
Draft bool
Expand Down

0 comments on commit 53a7583

Please sign in to comment.