updater

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package updater implements self-update for the pm CLI from GitHub Releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, rel *Release, targetPath string) error

Apply downloads rel's archive, verifies its checksum, extracts the pm binary, and atomically replaces targetPath with it.

func IsNewer

func IsNewer(current, latest string) bool

IsNewer reports whether latest is a greater semantic version than current. "dev" is treated as 0.0.0 so any real release is considered newer.

Types

type Release

type Release struct {
	Version     string
	ArchiveURL  string
	ChecksumURL string
}

Release describes an available pm release.

func Latest

func Latest(ctx context.Context) (*Release, error)

Latest queries the GitHub API for the latest pm release and resolves the archive and checksums asset URLs for the current OS/arch.

Jump to

Keyboard shortcuts

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