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 ¶
- Variables
- func Compare(a, b string) int
- func Executable() (string, error)
- func InstallRelease(ctx context.Context, version, exe string) error
- func Kept(version string) (string, bool)
- func Machine(ctx context.Context, c *client.Client, tr remote.Transport, say func(string)) error
- func Managed(exe string) error
- func Previous() string
- func Releases(ctx context.Context) ([]string, error)
- func Reload(ctx context.Context, c *client.Client, bin string) error
- func SameBuild(s proto.HelloResult) (same, ok bool)
- type Release
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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 ¶
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
Kept is the binary conch kept of version when it moved off it, so going back needs no download.
func Machine ¶
Machine installs this build on a remote machine and reloads its server onto it, keeping its panes.
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
Releases lists the versions published upstream — what the install script would fetch — newest first.
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.