Documentation ¶
Index ¶
- func DebugVersion(opts *Options) string
- func HowToUpdate(opts *Options) string
- func InstallLatest(opts *Options) (string, error)
- func IsLatestVersion(opts *Options) bool
- func ReportVersion(opts *Options) string
- func ShouldCheckForUpdates(upd *settings.UpdateCheck) bool
- type HomebrewOutdated
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugVersion ¶
DebugVersion returns a nicely formatted string representing the state of the current version. Intended to be printed to standard error for developers.
func HowToUpdate ¶
HowToUpdate returns a message teaching the user how to update to the latest version.
func InstallLatest ¶
InstallLatest will execute the updater and replace the current CLI with the latest version available.
func IsLatestVersion ¶
IsLatestVersion will tell us if the current version is the latest version available
func ReportVersion ¶
ReportVersion returns a nicely formatted string representing the state of the current version. Intended to be printed to the user.
func ShouldCheckForUpdates ¶
func ShouldCheckForUpdates(upd *settings.UpdateCheck) bool
ShouldCheckForUpdates tell us if the last update check was more than a day ago
Types ¶
type HomebrewOutdated ¶
type HomebrewOutdated []struct { Name string `json:"name"` InstalledVersions []string `json:"installed_versions"` CurrentVersion string `json:"current_version"` Pinned bool `json:"pinned"` PinnedVersion string `json:"pinned_version"` }
HomebrewOutdated wraps the JSON output from running `brew outdated --json=v1` We're specifically looking for this kind of structured data from the command:
[ { "name": "circleci", "installed_versions": [ "0.1.1248" ], "current_version": "0.1.3923", "pinned": false, "pinned_version": null }, ]
type Options ¶
type Options struct { Current semver.Version Found bool Latest *selfupdate.Release PackageManager string // contains filtered or unexported fields }
Options contains everything we need to check for or perform updates of the CLI.
func CheckForUpdates ¶
CheckForUpdates will check for updates given the proper package manager