update

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 11 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 Due

func Due(st *store.Store) bool

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

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 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