brew

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFormulaNotFound = errors.New("formula not found")

Functions

func FindCaskPath added in v0.6.0

func FindCaskPath(ctx context.Context, args []string) (string, error)

func FindInstalled

func FindInstalled(ctx context.Context, name string) (string, error)

func Install

func Install(ctx context.Context, args []string) error

func Uninstall

func Uninstall(ctx context.Context, name string) error

Types

type Cmd added in v0.6.0

type Cmd struct {
	Args []string
}

Cmd holds the arguments for brew commands.

func NewCmd added in v0.6.0

func NewCmd(action, pkg string, opts ...CmdOption) *Cmd

NewCmd constructs a new Cmd instance for brew.

type CmdOption added in v0.6.0

type CmdOption func(*Cmd)

CmdOption of BrewCmd.

func WithCask added in v0.6.0

func WithCask(isCask bool) CmdOption

func WithJSONV2 added in v0.6.0

func WithJSONV2() CmdOption

type Info added in v0.6.0

type Info struct {
	Name   string
	IsCask bool
}

func GetInfo added in v0.6.0

func GetInfo(ctx context.Context, args []string) (Info, error)

type InfoV2 added in v0.6.0

type InfoV2 struct {
	Formulae []struct {
		Name string
		Tap  string
	}
	Casks []struct {
		Token string
		Tap   string
	}
}

InfoV2 is the JSON payload returned by brew info --json=v2.

func (*InfoV2) GetInfo added in v0.6.0

func (i *InfoV2) GetInfo() Info

Jump to

Keyboard shortcuts

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