Documentation
¶
Index ¶
- type Updater
- func (u *Updater) Branch() string
- func (u *Updater) BranchExists(ctx context.Context) (bool, error)
- func (u *Updater) FormulaExists(ctx context.Context, path string) (bool, error)
- func (u *Updater) GetFormula(ctx context.Context, path string) ([]byte, error)
- func (u *Updater) IsRepoEmpty(ctx context.Context) (bool, error)
- func (u *Updater) UpdateFormula(ctx context.Context, path string, content []byte, message string) (string, error)
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 ¶
NewUpdater creates a new tap updater
func (*Updater) Branch ¶ added in v0.3.0
Branch returns the branch targeted for formula commits; when constructed with an empty branch it is resolved by UpdateFormula.
func (*Updater) BranchExists ¶
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 ¶
FormulaExists checks if a formula exists in the tap at the given repo path
func (*Updater) GetFormula ¶
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 ¶
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.