appupdate

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLastUsedVersion added in v1.0.0

func GetLastUsedVersion() string

GetLastUsedVersion reads the last used version from the version marker file. Returns empty string if no version marker exists (fresh install or v0.x user).

func GetMigrationMessage added in v1.0.0

func GetMigrationMessage() string

GetMigrationMessage returns the migration message shown to users upgrading from v0.x

func HandleSelfUpdate

func HandleSelfUpdate(
	currentVersion string,
	logger *zap.Logger,
	fs filesystem.FileSystem,
	updater Updater,
) chan string

func IsUpgradeFromV0 added in v1.0.0

func IsUpgradeFromV0() bool

IsUpgradeFromV0 checks if the user is upgrading from v0.x to v1.0+. This is detected when: 1. No version marker file exists (never tracked version before) 2. History file exists in the old v0.x location (~/.local/share/gsh/history.db)

func UpdateVersionMarker added in v1.0.0

func UpdateVersionMarker(version string) error

UpdateVersionMarker writes the current version to the version marker file.

Types

type DefaultRelease added in v0.9.2

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

func (DefaultRelease) AssetName added in v0.9.2

func (r DefaultRelease) AssetName() string

func (DefaultRelease) AssetURL added in v0.9.2

func (r DefaultRelease) AssetURL() string

func (DefaultRelease) Version added in v0.9.2

func (r DefaultRelease) Version() string

type DefaultUpdater added in v0.9.2

type DefaultUpdater struct{}

func (DefaultUpdater) DetectLatest added in v0.9.2

func (u DefaultUpdater) DetectLatest(ctx context.Context, slug string) (Release, bool, error)

func (DefaultUpdater) UpdateTo added in v0.9.2

func (u DefaultUpdater) UpdateTo(ctx context.Context, assetURL, assetName, exePath string) error

type Release added in v0.9.2

type Release interface {
	Version() string
	AssetURL() string
	AssetName() string
}

type Updater added in v0.9.2

type Updater interface {
	DetectLatest(ctx context.Context, slug string) (Release, bool, error)
	UpdateTo(ctx context.Context, assetURL, assetName, exePath string) error
}

Jump to

Keyboard shortcuts

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