update

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 10 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 tells a user that a newer release exists. Once a day a detached child asks the repository for its version tags (`git ls-remote`) and writes the newest to the state folder; the status line only reads that file. Nothing is downloaded or installed.

Index

Constants

View Source
const (
	Repo     = "https://github.com/lfeagan/claude-sitrep.git"
	Interval = 24 * time.Hour
	Deadline = 20 * time.Second
)

Variables

This section is empty.

Functions

func Check

func Check(ctx context.Context, run runner.Runner, st state.Store, now time.Time, repo string, env []string)

Check asks the repository for its newest release and records it. A failure leaves the record as the claim made it.

func Claim

func Claim(st state.Store, now time.Time) bool

Claim says whether a check is due, and if so records the attempt now, keeping what is known, so that a failing check is not retried before the next interval. Two hooks racing may both claim; the cost is one more `git ls-remote`.

func Notice

func Notice(st state.Store, current string) string

Notice is the line for the status line, or empty when the program is up to date or no check has found a newer release.

Types

type Record

type Record struct {
	Checked int64
	Latest  Version
}

Record is what the last check left: when it ran, and the newest release it saw (the zero Version when it saw none).

func Read

func Read(st state.Store) Record

Read returns the record; a missing or broken file is a record of no check.

type Version

type Version [3]int

Version is a release number. It is made only by Parse, so what is shown has the form MAJOR.MINOR.PATCH and nothing else.

func Newest

func Newest(out []byte) (Version, bool)

Newest is the highest version among the tags of `git ls-remote --tags --refs` output.

func Parse

func Parse(s string) (Version, bool)

Parse reads vMAJOR.MINOR.PATCH (the v is optional); each part is at most nine digits. Other tags, such as bash-final, are not versions.

func (Version) Newer

func (v Version) Newer(o Version) bool

Newer says whether v is a later release than o.

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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