Documentation ¶
Index ¶
- Constants
- func AddBazelVersion(path, version string) error
- func DownloadBazelVersion(version string) (string, error)
- func EnsureBazenvDir()
- func FindAndReadLocalBazenvFile() (*string, error)
- func ListBazelVersions() ([]string, error)
- func ReadBazenvFile() (string, error)
- func ReadGlobalBazenvFile() (*string, error)
- func RemoveBazelVersion(version string) error
- func ResolveBazelDirectory(version string) (string, error)
- func SetGlobalBazelVersion(version string) error
- func SetLocalBazelVersion(version string) error
- func SniffBazelVersion(path string) (string, error)
- func SniffIsBazenvStub() (bool, error)
Constants ¶
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 ¶
AddBazelVersion adds an existing bazel version (specified by path) to the set fo bazel versions known to bazenv
func DownloadBazelVersion ¶
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 ¶
FindAndReadLocalBazenvFile returns the contents of the local bazenv file, walking up the directory tree if needed to find one
func ListBazelVersions ¶
ListBazelVersions lists all bazel versions known to bazenv
func ReadBazenvFile ¶
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 ¶
ReadGlobalBazenvFile returns the contents of global bazenv file
func RemoveBazelVersion ¶
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 ¶
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 ¶
SetGlobalBazelVersion sets a global bazenv_version file in ~/.bazenv/bazenv_version
func SetLocalBazelVersion ¶
SetLocalBazelVersion sets a local .bazenv_version file in CWD
func SniffBazelVersion ¶
SniffBazelVersion uses the 'bazel version' command to return the version name of a bazel directory, or returns an error.
func SniffIsBazenvStub ¶
SniffIsBazenvStub returns true of the installed bazel command is a bazenv stub
Types ¶
This section is empty.