update

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package update implements `mp2rss update` self-updating the installed binary.

Flow:

  1. Query GitHub Releases API for the latest tag.
  2. Compare with the build-time injected version. --check exits here.
  3. Pick the platform archive (tar.gz / zip), download to a temp dir.
  4. Download checksums.txt and verify SHA-256.
  5. Extract the binary, stage it at <selfpath>.new, then os.Rename atomically.
  6. macOS only: strip the Gatekeeper quarantine xattr so the binary runs.

`os.Executable()` plus `filepath.EvalSymlinks` resolves the path so users installed via Homebrew / npm postinstall symlinks still get updated in place.

Index

Constants

This section is empty.

Variables

View Source
var DownloadBase = func() string {
	return fmt.Sprintf("https://github.com/%s/releases/download", Repo)
}

DownloadBase is overridable so tests can point at httptest servers.

View Source
var LatestReleaseURL = func() string {
	return fmt.Sprintf("https://api.github.com/repos/%s/releases/latest", Repo)
}

LatestReleaseURL is overridable so tests can point at httptest servers.

View Source
var Repo = "areyoubugcoder/mp2rss-cli"

Repo is the GitHub slug we pull releases from. Exposed as a var so tests (and future enterprise builds) can repoint it.

Functions

func LookupChecksum

func LookupChecksum(path, filename string) (string, error)

LookupChecksum returns the hex digest recorded in a `sha256sum`-style checksums.txt file for the given filename. Exposed for testing.

func NewCmd

func NewCmd() *cobra.Command

NewCmd returns the `mp2rss update` command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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