Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCI ¶
func IsCI() bool
IsCI determines if the current execution context is within a known CI/CD system. This is based on https://github.com/watson/ci-info/blob/HEAD/index.js.
func IsTerminal ¶
IsTerminal determines if a file descriptor is an interactive terminal / TTY.
func ShouldCheckForExtensionUpdate ¶
func ShouldCheckForExtensionUpdate() bool
ShouldCheckForExtensionUpdate decides whether we check for updates for GitHub CLI extensions based on user preferences and current execution context. During cli/cli#9934, this logic was split out from ShouldCheckForUpdate() because we envisioned it going in a different direction.
func ShouldCheckForUpdate ¶
func ShouldCheckForUpdate() bool
ShouldCheckForUpdate decides whether we check for updates for the GitHub CLI based on user preferences and current execution context.
Types ¶
type ReleaseInfo ¶
type ReleaseInfo struct {
Version string `json:"tag_name"`
URL string `json:"html_url"`
PublishedAt time.Time `json:"published_at"`
}
ReleaseInfo stores information about a release
func CheckForExtensionUpdate ¶
func CheckForExtensionUpdate(em extensions.ExtensionManager, ext extensions.Extension, now time.Time) (*ReleaseInfo, error)
CheckForExtensionUpdate checks whether an update exists for a specific extension based on extension type and recency of last check within past 24 hours.
func CheckForUpdate ¶
func CheckForUpdate(ctx context.Context, client *http.Client, stateFilePath, repo, currentVersion string) (*ReleaseInfo, error)
CheckForUpdate checks whether an update exists for the GitHub CLI based on recency of last check within past 24 hours.
type StateEntry ¶
type StateEntry struct {
CheckedForUpdateAt time.Time `yaml:"checked_for_update_at"`
LatestRelease ReleaseInfo `yaml:"latest_release"`
}