updater

package
v0.0.0-...-e42a1e5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package updater contains the type Updater to update Bazel workspace and module snippets.

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 Bazel workspace and module snippets. The zero Updater is not valid; use New to create Updater objects.

func New

func New(dir string, client *http.Client, urlPrefix string) (*Updater, error)

New creates a new Updater. dir must be a directory within a checked-out Git repository. The repository must have exactly one remote whose URL starts with urlPrefix (normally https://github.com/). The remote must support GitHub’s archive functionality.

func (*Updater) Update

func (u *Updater) Update(file string) error

Update updates commit and archive hashes within the given file. The file must contain at least one stanza of the form

git_override(
    module_name = "…",
    remote = "…",
    commit = "〈hash〉",
)

or

http_archive(
    name = "…",
    urls = ["https://github.com/owner/repo/archive/〈hash〉.zip"],
    sha256 = "…",
    integrity = "…",
    strip_prefix = "repo-〈hash〉",
)

Update replaces the hashes with the values from the upstream HEAD commit.

Jump to

Keyboard shortcuts

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