update

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 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 newer conch builds — a rebuilt or downloaded binary, a GitHub release, machines running older builds — and applies them without stopping panes: binaries are replaced, servers reloaded.

Index

Constants

This section is empty.

Variables

View Source
var ErrHomebrew = errors.New("conch was installed with Homebrew: update it with brew upgrade conch")

ErrHomebrew is an update refused because Homebrew installed conch.

Functions

func AppReplaceable added in v0.2.1

func AppReplaceable(app string) error

AppReplaceable says why the Conch.app at app cannot be replaced by an update, or nil when it can: run translocated (macOS's random read-only copy of an app opened where it was downloaded), from its disk image, or from somewhere this user cannot write — an install made by an admin. The update renames the bundle within its folder, so both have to be writable.

func AppVersion added in v0.2.1

func AppVersion(app string) (string, bool)

AppVersion reads an app's CFBundleShortVersionString; ok is false when there is no bundle there.

func Compare

func Compare(a, b string) int

Compare orders versions like "0.2.0" and "0.10.1-rc.1": -1, 0 or 1, as SemVer does. Pre-release suffixes sort before the release; build metadata ("+build.5") is ignored.

func Executable

func Executable() (string, error)

Executable is the running conch's path, symlinks resolved — except a Homebrew install's, which is its opt link (buildinfo.Stable): the file to watch for a new build, and to restart onto, is wherever brew puts the next version.

func InstallApp added in v0.2.1

func InstallApp(ctx context.Context, version, app string, say func(string)) error

InstallApp replaces the Conch.app at app with release version: it downloads the release's archive and checks its checksum, unpacks it beside the app (the same volume, so the swap is a rename), checks the version inside and its signature, and then swaps the two, keeping the one it replaces for RollbackApp. Anything refused leaves the app as it was and nothing beside it. The running app carries on from the files it has open; the new one runs from its next launch.

func InstallRelease

func InstallRelease(ctx context.Context, version, exe string) error

InstallRelease puts the conch of version over the executable at exe: the published release for this platform, or the copy kept when conch moved off that version. The outgoing binary is kept and noted, so moving back to it later needs no download. version may be older than the running one — going backwards is the same swap.

func Kept added in v0.1.3

func Kept(version string) (string, bool)

Kept is the binary conch kept of version when it moved off it, so going back needs no download.

func Machine

func Machine(ctx context.Context, c *client.Client, tr remote.Transport, say func(string)) error

Machine installs this build on a remote machine and reloads its server onto it, keeping its panes.

func Managed added in v0.1.9

func Managed(exe string) error

Managed is ErrHomebrew for a conch that Homebrew owns, else nil.

func Previous added in v0.1.3

func Previous() string

Previous is the version conch ran before the last update or move back, "" when none was recorded (a fresh install, or the note was removed). Moving back notes the version left behind in turn, so back and forward are the same step.

func PreviousApp added in v0.2.1

func PreviousApp(app string) (string, bool)

PreviousApp is the version of the app kept from the last update, if any.

func Releases added in v0.1.3

func Releases(ctx context.Context) ([]string, error)

Releases lists the versions published upstream — what the install script would fetch — newest first.

func Reload

func Reload(ctx context.Context, c *client.Client, bin string) error

Reload asks a server to reload into bin ("" for its own executable).

func RollbackApp added in v0.2.1

func RollbackApp(app string) error

RollbackApp swaps the app with the one kept from the last update, so the release just undone is kept in turn and can be gone forward to.

func SameBuild

func SameBuild(s proto.HelloResult) (same, ok bool)

SameBuild reports whether a server runs the same conch as this process. Release builds compare versions (a downloaded binary for another platform has its own hash); development builds compare build IDs, which cross-built binaries inherit. ok is false when the server can't tell.

func VerifyApp added in v0.2.1

func VerifyApp(ctx context.Context, next, running string) error

VerifyApp checks a downloaded Conch.app before it replaces the running one: its signature intact (deep and strict), made by the same team as the app running now, and accepted by Gatekeeper as notarized. A running app signed ad hoc — built by hand — has no team to match, so it is refused too: nothing would say the download came from the same hands.

Types

type AppCheck added in v0.2.1

type AppCheck struct {
	// Current is the app's own version, as it was given.
	Current string `json:"current"`
	// Dev is a build from source, which never asks: it updates from source.
	Dev bool `json:"dev,omitempty"`
	// Latest is the newest published release, when one was asked for.
	Latest string `json:"latest,omitempty"`
	// Newer is Latest being newer than Current.
	Newer bool `json:"newer,omitempty"`
	// Notes is the page the release is described on.
	Notes string `json:"notes,omitempty"`
	// Asset is the archive this Mac would download, or "" with Unavailable
	// saying why there is none (an Intel Mac).
	Asset       string `json:"asset,omitempty"`
	Unavailable string `json:"unavailable,omitempty"`
}

AppCheck is what Conch.app's check for a newer release of itself found (`conch app update check -json`, which the app reads).

func CheckApp added in v0.2.1

func CheckApp(ctx context.Context, current string) (AppCheck, error)

CheckApp asks for the latest release, as conch's own check does (remote.LatestRelease), and compares it with the app's version.

type Release

type Release struct {
	Version string
}

Release is a newer published release than this build, if any.

func NewerRelease

func NewerRelease(ctx context.Context) (*Release, error)

NewerRelease checks GitHub for a release newer than this build. Development builds never ask: they update from source.

Jump to

Keyboard shortcuts

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