Documentation
¶
Overview ¶
Package version implements the 'eng version' command, which displays the application's version information and checks for available updates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of eng and check for updates", Long: `Displays the application's version, build commit, build date, Go version, and target OS/Architecture. It also checks the GitHub repository (eng618/eng) for the latest official release and compares it with the currently running version. If a newer version is available, you can use the --update flag to attempt an automatic upgrade via Homebrew (if installed that way) or via the install script (if installed via curl).`, Run: func(cmd *cobra.Command, _args []string) { isVerbose, _ := cmd.Flags().GetBool("verbose") printVersionInfo(isVerbose) var sp *ui.Spinner if !ui.DisableProgress { sp = ui.NewSpinner("Checking for latest version...") sp.Start() } latestRelease, err := getLatestRelease(githubRepoOwner, githubRepoName, isVerbose) if sp != nil { sp.Stop() } if err != nil { log.Warn("Could not check for updates: %v", err) return } if latestRelease == nil || latestRelease.TagName == "" { log.Warn("Could not determine the latest release version from GitHub.") return } if appversion.Version == "dev" { handleDevVersion(latestRelease) return } currentSemVer, latestSemVer, err := parseVersions(appversion.Version, latestRelease.TagName) if err != nil { log.Info("Latest release is %s: %s", latestRelease.TagName, latestRelease.HTMLURL) return } compareAndHandleUpdate(currentSemVer, latestSemVer, latestRelease, isVerbose) }, }
VersionCmd represents the Cobra command for 'eng version'. It displays the current version details and checks GitHub for the latest release. Includes an optional --update flag to attempt an update via Homebrew.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.