update

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package update finds out whether a newer triage release exists and installs it.

Index

Constants

View Source
const (
	// ReleaseRepo is where triage releases are published.
	ReleaseRepo = "aloglu/triage"
	// Package is what `go install` installs.
	Package = "github.com/aloglu/triage/cmd/triage"
)

Variables

This section is empty.

Functions

func AssetName added in v0.3.2

func AssetName(goos, goarch string) string

AssetName is the release archive for a platform.

func Due

func Due(st *store.Store) bool

Due reports whether it's time to ask GitHub again.

func Executable added in v0.3.2

func Executable() (string, error)

Executable returns the path of the running binary, with symlinks resolved.

func Install

func Install(ctx context.Context, version string) (string, error)

Install runs `go install` for version and returns where the binary went.

func InstallDir

func InstallDir(goBin string) string

InstallDir returns the directory `go install` writes binaries to.

func InstallRelease added in v0.3.2

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

InstallRelease replaces the binary at target with version's release build for this platform. The download is checked against the release's checksums, and target is replaced in one step, so a failure at any point leaves the current binary untouched.

func IsRelease

func IsRelease(version string) bool

IsRelease reports whether version is a tagged release, as opposed to a development build, which never gets update notices.

func Newer

func Newer(current, latest string) bool

Newer reports whether latest is a newer release than current.

func RunningFrom

func RunningFrom() string

RunningFrom returns the directory of the running triage binary.

Types

type Release

type Release struct {
	Version string
	Notes   string
	URL     string
}

Release describes an available version.

func Cached

func Cached(st *store.Store, current string) (Release, bool)

Cached returns the newest release seen so far if it's newer than current, without contacting GitHub.

func Check

func Check(ctx context.Context, client *gh.Client, st *store.Store, current string) (Release, bool, error)

Check asks GitHub for the latest release, remembers it, and returns it when it's newer than current.

func ShouldNotify

func ShouldNotify(st *store.Store, current string) (Release, bool)

ShouldNotify reports whether the command line should mention an update now, at most once a day; it records that it did.

Jump to

Keyboard shortcuts

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