update

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 14 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 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 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 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 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.

Types

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