update

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package update finds monolith's latest GitHub release and installs a release over the running binary, with the checks install.sh makes: the archive's sha256 against the release's checksums.txt, then the binary's code signature and virtualization entitlement.

Index

Constants

View Source
const (

	// EnvNoCheck turns off the release check in 'monolith --version'.
	EnvNoCheck = "MONOLITH_NO_UPDATE_CHECK"
)

Environment overrides, for mirrors and tests. MONOLITH_BASE_URL is the same variable install.sh reads.

Variables

This section is empty.

Functions

func Canonical

func Canonical(v string) string

Canonical adds the "v" release tags have, so "0.1.0" is "v0.1.0".

func CheckLatest

func CheckLatest() (string, error)

CheckLatest is Latest with a short timeout, for 'monolith --version'.

func Compare

func Compare(a, b string) int

Compare compares two release versions like semver: -1, 0 or +1.

func Download

func Download(ctx context.Context, client *http.Client, version, dir string, log io.Writer) (string, error)

Download fetches version's release archive and checksums into dir, checks the archive's sha256 and returns the path of the binary it extracted. log gets a line per stage.

func IsRelease

func IsRelease(v string) bool

IsRelease reports whether v is a release build's version: a semver tag, not "dev" or a git describe of a commit past one.

func Latest

func Latest(ctx context.Context, client *http.Client) (string, error)

Latest returns the tag of the latest release, e.g. "v0.1.0".

func Replace

func Replace(src, dst string) (sudo bool, err error)

Replace puts the binary at src in dst's place. If dst's directory is writable it's a rename of a copy made next to dst, so dst is never half written; otherwise it runs sudo install, which asks for a password on the terminal. It reports whether sudo was used.

func Target

func Target() (string, error)

Target is the binary to replace: the running executable, symlinks resolved.

func VerifySignature

func VerifySignature(path string) error

VerifySignature checks that the binary at path has a valid code signature and the virtualization entitlement, which monolith needs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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