appupdate

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 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

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

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

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

func UpdateVersionMarker(version string) error

UpdateVersionMarker writes the current version to the version marker file.

Types

type DefaultRelease

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

func (DefaultRelease) AssetName

func (r DefaultRelease) AssetName() string

func (DefaultRelease) AssetURL

func (r DefaultRelease) AssetURL() string

func (DefaultRelease) Version

func (r DefaultRelease) Version() string

type DefaultUpdater

type DefaultUpdater struct{}

func (DefaultUpdater) DetectLatest

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

func (DefaultUpdater) UpdateTo

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

type Release

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

type Updater

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