cmd

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateShellCompletionScriptGenCommand added in v0.0.10

func CreateShellCompletionScriptGenCommand() *cobra.Command

CreateShellCompletionScriptGenCommand generates completion shell scripts

func CreateUpdateCommand

func CreateUpdateCommand(owner, repo, version, binaryName string) *cobra.Command

CreateUpdateCommand creates the 'config' sub command

func RunSelfUpdate

func RunSelfUpdate(owner, repo, requestedTag, version, binaryName string, resolveBinaryPathFn ResolveBinaryPathFn, getReleaseFn GetReleaseFn) (err error)

RunSelfUpdate checks whether the github.com/owner/repo has a release that is more recent that the specified version. If one exists, tries to find a binary asset that matches the current platform and the provided binaryName. If one is found, it is downloaded to the path of the current executable.

func RunSelfUpdateFn

func RunSelfUpdateFn(owner, repo, currentVersion, binaryName string) func(cmd *cobra.Command, args []string)

RunSelfUpdateFn runs the self update command based on the current version and binary name. currentVersion is used to determine whether a newer one is available

Types

type GetReleaseFn

type GetReleaseFn = func(owner, repo, tag string) (Release, error)

GetReleaseFn ...

type Release

type Release interface {
	TagName() string
	DownloadBinary(string) (io.ReadCloser, error)
}

Release a GitHub realease facade

func GetLatestRelease

func GetLatestRelease(owner, repo, tag string) (release Release, err error)

GetLatestRelease returns the latest github non-draft release of this program.

type ResolveBinaryPathFn

type ResolveBinaryPathFn = func() (string, error)

ResolveBinaryPathFn ...

Jump to

Keyboard shortcuts

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