update

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 13 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 RenderMarkdown added in v1.6.0

func RenderMarkdown(content string) string

RenderMarkdown uses glamour to style markdown content.

func Update

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

func UpdateConfig added in v1.6.0

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

Types

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