update

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 12 Imported by: 0

README

Update Command

Updates the tool to the latest or specified version.

For detailed information on update processes and migration, see the Built-in Commands Documentation.

Documentation

Overview

Package update provides the Cobra command for self-updating the CLI binary to the latest released version from the configured release source (GitHub or GitLab), with support for private repositories via token authentication.

Index

Constants

This section is empty.

Variables

View Source
var (

	// allow mocking in tests.
	ExportExecCommand = exec.CommandContext
	ExportNewUpdater  = func(props *p.Props, version string, force bool) (Updater, error) {
		return setup.NewUpdater(props, version, force)
	}
)

Functions

func NewCmdUpdate

func NewCmdUpdate(props *p.Props) *cobra.Command

func UpdateConfig added in v1.6.0

func UpdateConfig(ctx context.Context, props *p.Props, binPath string)

Types

type UpdateResult added in v1.7.0

type UpdateResult struct {
	PreviousVersion string `json:"previous_version"`
	NewVersion      string `json:"new_version"`
	Updated         bool   `json:"updated"`
}

UpdateResult contains the outcome of a successful update.

func Update

func Update(ctx context.Context, props *p.Props, version string, force bool) (*UpdateResult, error)

type Updater added in v1.6.0

type Updater interface {
	GetLatestVersionString(ctx context.Context) (string, error)
	Update(ctx context.Context) (string, error)
	GetReleaseNotes(ctx context.Context, from, to string) (string, error)
	GetCurrentVersion() string
}

Updater defines the interface for self-updating functionality.

Jump to

Keyboard shortcuts

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