update

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, params Params, stdout, stderr io.Writer) error

Run is the entry point for the `update` command. The actual update is always delegated to npm (never a silent binary swap) so npm keeps owning the version bookkeeping; on Windows the running .exe is renamed to .old first and rolled back if the install or verification fails.

Types

type Params

type Params struct {
	CheckOnly bool
	Force     bool
	JSON      bool
}

Params controls the update command behaviour.

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater manages self-update operations. Platform-specific methods (PrepareSelfReplace, CleanupStaleFiles, CanRestorePreviousVersion) live in selfreplace_unix.go and selfreplace_windows.go.

func (*Updater) CanRestorePreviousVersion

func (u *Updater) CanRestorePreviousVersion() bool

CanRestorePreviousVersion reports whether PrepareSelfReplace created a restorable backup for the current update attempt.

func (*Updater) CleanupStaleFiles

func (u *Updater) CleanupStaleFiles()

CleanupStaleFiles is a no-op on Unix (no .old files are created).

func (*Updater) PrepareSelfReplace

func (u *Updater) PrepareSelfReplace() (restore func(), err error)

PrepareSelfReplace is a no-op on Unix, which allows overwriting a running executable via inode semantics.

Jump to

Keyboard shortcuts

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