Help us shape the future of Go! Take the 2026 Go Developer Survey

update

package
v1.65.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BrewCmd = &cobra.Command{
	Use:   "brew",
	Short: "Update Homebrew packages only",
	Long:  `This command updates only Homebrew packages, skipping system updates.`,
	Run: func(cmd *cobra.Command, _args []string) {
		isVerbose := cmdutil.IsVerbose(cmd)
		updateBrew(isVerbose)
	},
}

BrewCmd represents the Homebrew update subcommand.

View Source
var UpdateCmd = &cobra.Command{
	Use:     "update",
	Aliases: []string{"upgrade", "u"},
	Short:   "Update the system and perform maintenance",
	Long:    `This command updates the system, Homebrew packages, asdf plugins, flatpak packages, and performs cleanup operations.`,
	Run: func(cmd *cobra.Command, _args []string) {
		headerStyle := lipgloss.NewStyle().
			Bold(true).
			Foreground(theme.Primary).
			MarginBottom(1)
		if !ui.DisableProgress {
			fmt.Fprintln(log.Out, headerStyle.Render("🚀 System Maintenance & Update"))
		}

		isVerbose := cmdutil.IsVerbose(cmd)
		autoApprove, _ := cmd.Flags().GetBool("yes")
		cleanupTimeout, _ := cmd.Flags().GetInt("cleanup-timeout")

		logPath, stopLog := runlog.Start("system-update")
		defer stopLog()
		defer runlog.Finish(logPath)

		log.Verbose(isVerbose, "Checking system type...")

		distro := detectDistro()
		log.Verbose(isVerbose, "System detected: %s (OS: %s, ID: %s)", distro.PrettyName, distro.RawOS, distro.ID)

		if distro.IsFedora() {
			log.Verbose(isVerbose, "Detected Fedora/RHEL system, running DNF system update...")
			updateFedora(isVerbose, autoApprove, cleanupTimeout)
		} else if distro.IsDebianUbuntu() {
			log.Verbose(isVerbose, "Detected Debian/Ubuntu system, running APT system update...")
			updateDebianUbuntu(isVerbose, autoApprove, cleanupTimeout)
		} else if distro.IsMacOS() {
			log.Verbose(isVerbose, "Detected macOS system, running macOS update...")
			updateMacOS(isVerbose)
		} else if distro.IsRaspberryPi() {
			log.Verbose(isVerbose, "Detected Raspberry Pi system, running Raspberry Pi update...")
			updateRaspberryPi(isVerbose, autoApprove, cleanupTimeout)
		} else if distro.IsLinux() {
			log.Verbose(isVerbose, "Detected generic Linux system, running general maintenance...")
			updateGenericLinux(isVerbose, autoApprove, cleanupTimeout)
		} else {
			log.Warn("This system is not yet configured for automated OS updates.")
			log.Verbose(isVerbose, "System type: %s", distro.PrettyName)
			updateBrew(isVerbose)
			updateAsdf(isVerbose)
		}
	},
}

UpdateCmd represents the system update command.

View Source
var UpdateIdeCmd = &cobra.Command{
	Use:     "ide [archive-path-or-url]",
	Aliases: []string{"agy-ide", "antigravity-ide", "antigravity"},
	Short:   "Update or install Antigravity IDE",
	Long: `Download, validate, and install the latest Antigravity IDE release package.
Supports automated download, detecting downloaded archives in ~/Downloads, or specifying an archive directly.`,
	RunE: func(cmd *cobra.Command, args []string) error {
		filePath, _ := cmd.Flags().GetString("file")
		urlPath, _ := cmd.Flags().GetString("url")
		autoApprove, _ := cmd.Flags().GetBool("yes")

		target := ""
		if len(args) > 0 {
			target = args[0]
		} else if filePath != "" {
			target = filePath
		} else if urlPath != "" {
			target = urlPath
		}

		return RunIdeUpdate(cmd.Context(), target, cmdutil.IsVerbose(cmd), autoApprove)
	},
}

UpdateIdeCmd represents the command to update Antigravity IDE.

Functions

func RunIdeUpdate

func RunIdeUpdate(ctx context.Context, target string, verbose, autoApprove bool) error

RunIdeUpdate orchestrates finding, downloading, extracting, validating, and installing the IDE.

Types

This section is empty.

Jump to

Keyboard shortcuts

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