binupdate

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package binupdate owns standalone released-binary update mechanics and version/install classification.

Index

Constants

View Source
const (
	RepoOwner = "pyranthus-hq"
	RepoName  = "mora"
)

Variables

This section is empty.

Functions

func FirstNonEmpty

func FirstNonEmpty(vals ...string) string

func IsHomebrewManaged

func IsHomebrewManaged(resolvedExe string) bool

func LocalBuildBase

func LocalBuildBase(version string) (base string, ok bool)

func OldSavePath

func OldSavePath(exe, goos string) string

func Run

func Run(ctx context.Context, o Options) error

Types

type Options

type Options struct {
	Current, Executable, Token, GOOS string
	CheckOnly                        bool
	Stdout                           io.Writer
	PostRebuild                      func(context.Context, string, io.Writer) error
	Detect                           func(context.Context) (Release, bool, error)
	Apply                            func(context.Context, Release, string) error
}

type Release

type Release struct {
	Version, AssetName string
	// contains filtered or unexported fields
}

type Route

type Route string
const (
	RouteApp      Route = "app"
	RouteHomebrew Route = "homebrew"
	RouteSource   Route = "source"
	RouteDirect   Route = "direct"
)

func Classify

func Classify(exe, buildVersion string, isApp func(string) bool) Route

type Verdict

type Verdict int
const (
	// VerdictUpgrade: the latest release is genuinely newer — offer/install it.
	VerdictUpgrade Verdict = iota
	// VerdictUpToDate: the running binary already is (or is past) the latest release.
	VerdictUpToDate
	// VerdictLocalAhead: the running binary is a local git build at or ahead of
	// the latest release's tag — "upgrading" would be a downgrade; refuse.
	VerdictLocalAhead
)

func Decide

func Decide(current, latestVersion string) (verdict Verdict, isLocal bool, err error)

Jump to

Keyboard shortcuts

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