update

package
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package update tells someone at a terminal, at most once a day, that a newer release of the CLI exists. With npm gone, nothing else would: a downloaded binary stays as it is.

Index

Constants

This section is empty.

Variables

View Source
var Interactive = func() bool {
	return !turnedOff(os.Getenv) && term.IsTerminal(int(os.Stderr.Fd()))
}

Interactive reports whether a notice would be seen, and not end up in a CI log or in output a script reads. Tests replace it.

View Source
var LatestURL = "https://github.com/steadybit/cli/releases/latest"

LatestURL redirects to the tag of the latest release. Asking where it redirects costs none of the GitHub API's rate limit. Tests point it elsewhere.

View Source
var Now = time.Now

Now is the clock the daily check is measured against. Tests replace it.

Functions

func Start

func Start(current, cacheFile string) (notice func(io.Writer))

Start checks for a newer release when a check is due, while the command runs. The function it returns prints the notice, after the command, from what is known by then. A build that is not a release, such as one from `go install ...@main`, is never told.

Types

This section is empty.

Jump to

Keyboard shortcuts

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