Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UpdateCmd = &cobra.Command{ Use: "update", Short: "Update to the latest version of scf", Long: "Update to the latest version of scf", Run: func(cmd *cobra.Command, args []string) { currentVersion, err := versioninfo.GetVersion() cobra.CheckErr(err) isUpdate, newVersion, err := versioninfo.CheckForUpdate() cobra.CheckErr(err) if !isUpdate { fmt.Printf("Current version, %s, is the latest. Nothing to update.\n", currentVersion) } else { fmt.Printf("Updating from version %s to version %s\n", currentVersion, newVersion) err = versioninfo.Update() if err != nil { var notSupportedError *updater.NotSupportedError if errors.As(err, ¬SupportedError) { fmt.Printf("Self updating is not supported for %s. Please reinstall.", notSupportedError.Platform) } else { fmt.Println(err) } os.Exit(1) } fmt.Printf("Updated to version %s\n", newVersion) } }, }
updateCmd represents the update command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.