tap

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

type Updater struct {
	// 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