tap

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

type Updater struct {

	// Log, when set, receives human progress lines.
	Log func(string)
	// contains filtered or unexported fields
}

Updater updates formulas in a Homebrew tap repository

func NewUpdater

func NewUpdater(token, owner, repo, branch string) (*Updater, error)

NewUpdater creates a new tap updater

func (*Updater) Branch added in v0.3.0

func (u *Updater) Branch() string

Branch returns the branch targeted for formula commits; when constructed with an empty branch it is resolved by UpdateFormula.

func (*Updater) BranchExists

func (u *Updater) BranchExists(ctx context.Context) (bool, error)

BranchExists checks if the specified branch exists in the repository. Git.GetRef is used deliberately: Repositories.GetBranch follows redirects itself and returns a plain error (not *github.ErrorResponse) on 404, which would turn "branch missing" into a hard failure.

func (*Updater) FormulaExists

func (u *Updater) FormulaExists(ctx context.Context, path string) (bool, error)

FormulaExists checks if a formula exists in the tap at the given repo path

func (*Updater) GetFormula

func (u *Updater) GetFormula(ctx context.Context, path string) ([]byte, error)

GetFormula fetches the current formula content at the given repo path. Returns the file content or an error if the file doesn't exist.

func (*Updater) IsRepoEmpty

func (u *Updater) IsRepoEmpty(ctx context.Context) (bool, error)

IsRepoEmpty checks if the repository has any commits

func (*Updater) UpdateFormula

func (u *Updater) UpdateFormula(ctx context.Context, path string, content []byte, message string) (string, error)

UpdateFormula creates or updates a formula file in the tap and returns the commit SHA. path is the file path within the repository (e.g. "Formula/myapp.rb"); content is the complete formula; message is the commit message.

Jump to

Keyboard shortcuts

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