bazenv

package
v0.0.0-...-225ee54 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BazenvDir is the name of the bazenv config directory in the user's home directory
	BazenvDir = ".bazenv"
	// BazenvVersionsDir is the directory under BazenvDir where bazel versions are stored
	BazenvVersionsDir = "bazel"
	// BazenvFile is the name of a bazenv version file, prefixed with dot when not in BazenvDir
	BazenvFile = "bazenv_version"
)

Variables

This section is empty.

Functions

func AddBazelVersion

func AddBazelVersion(path, version string) error

AddBazelVersion adds an existing bazel version (specified by path) to the set fo bazel versions known to bazenv

func DownloadBazelVersion

func DownloadBazelVersion(version string) (string, error)

DownloadBazelVersion downloads an OS-specific bazel installer into the bazenv working directory

func EnsureBazenvDir

func EnsureBazenvDir()

EnsureBazenvDir creates the bazenv working directoy if not found

func FindAndReadLocalBazenvFile

func FindAndReadLocalBazenvFile() (*string, error)

FindAndReadLocalBazenvFile returns the contents of the local bazenv file, walking up the directory tree if needed to find one

func ListBazelVersions

func ListBazelVersions() ([]string, error)

ListBazelVersions lists all bazel versions known to bazenv

func ReadBazenvFile

func ReadBazenvFile() (string, error)

ReadBazenvFile reads the content of .bazenv_version, looking locally up the directiory tree first, then in the global bazenv file. This returns the name of the active bazel version.

func ReadGlobalBazenvFile

func ReadGlobalBazenvFile() (*string, error)

ReadGlobalBazenvFile returns the contents of global bazenv file

func RemoveBazelVersion

func RemoveBazelVersion(version string) error

RemoveBazelVersion removes a bazel version from the set of versions known to bazenv. If the version is a symlink the symlink is deleted. If the version is a directory, the entire tree is deleted.

func ResolveBazelDirectory

func ResolveBazelDirectory(version string) (string, error)

ResolveBazelDirectory converts a bazel version name into the path to a bazel install directory, or retuns an error if the install doesn't exist.

func SetGlobalBazelVersion

func SetGlobalBazelVersion(version string) error

SetGlobalBazelVersion sets a global bazenv_version file in ~/.bazenv/bazenv_version

func SetLocalBazelVersion

func SetLocalBazelVersion(version string) error

SetLocalBazelVersion sets a local .bazenv_version file in CWD

func SniffBazelVersion

func SniffBazelVersion(path string) (string, error)

SniffBazelVersion uses the 'bazel version' command to return the version name of a bazel directory, or returns an error.

func SniffIsBazenvStub

func SniffIsBazenvStub() (bool, error)

SniffIsBazenvStub returns true of the installed bazel command is a bazenv stub

Types

This section is empty.

Jump to

Keyboard shortcuts

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