update

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCheckInterval is the default time between update checks
	DefaultCheckInterval = 24 * time.Hour

	// GitHubRepo is the repository to check for updates
	GitHubRepo = "jfox85/devx"
)

Variables

This section is empty.

Functions

func CanSelfUpdate

func CanSelfUpdate() bool

CanSelfUpdate returns true if the installation method supports self-update

func GetUpdateInstructions

func GetUpdateInstructions() string

GetUpdateInstructions returns platform-specific update instructions

func MarkUpdateNotified

func MarkUpdateNotified(latestVersion string) error

MarkUpdateNotified marks an update version as having been shown to the user This should be called after successfully displaying an update notification

func PerformUpdate

func PerformUpdate(force bool) error

PerformUpdate downloads and installs the latest version

func ShouldNotifyUser

func ShouldNotifyUser(info *UpdateInfo) (bool, error)

ShouldNotifyUser determines if we should notify the user about an update Returns true if: - An update is available - We haven't already notified about this version

func UpdateAvailable

func UpdateAvailable() (bool, string, error)

UpdateAvailable checks if an update is available without downloading

Types

type InstallMethod

type InstallMethod string

InstallMethod represents how devx was installed

const (
	InstallMethodHomebrew  InstallMethod = "homebrew"
	InstallMethodGoInstall InstallMethod = "go-install"
	InstallMethodManual    InstallMethod = "manual"
	InstallMethodUnknown   InstallMethod = "unknown"
)

func DetectInstallMethod

func DetectInstallMethod() InstallMethod

DetectInstallMethod tries to determine how devx was installed

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion string
	LatestVersion  string
	ReleaseNotes   string
	ReleaseURL     string
	Available      bool
}

UpdateInfo contains information about an available update

func CheckForUpdates

func CheckForUpdates() (*UpdateInfo, error)

CheckForUpdates checks GitHub for a newer version

func CheckForUpdatesWithCache

func CheckForUpdatesWithCache(interval time.Duration) (*UpdateInfo, bool, error)

CheckForUpdatesWithCache checks for updates if the check interval has passed

Jump to

Keyboard shortcuts

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