...

Package wspace

import "github.com/bazelbuild/bazel-gazelle/internal/wspace"
Overview
Index

Overview ▾

Package wspace provides functions to locate and modify a bazel WORKSPACE file.

func FindRepoRoot

func FindRepoRoot(dir string) (string, error)

FindRepoRoot searches from the given dir and up for a directory containing a WORKSPACE file returning the directory containing it, or an error if none found in the tree.

func FindWORKSPACEFile

func FindWORKSPACEFile(root string) string

FindWORKSPACEFile returns a path to a file in the provided root directory, either to an existing WORKSPACE or WORKSPACE.bazel file, or to root/WORKSPACE if neither exists. Note that this function does NOT recursively check parent directories.

func IsWORKSPACE

func IsWORKSPACE(path string) bool

IsWORKSPACE checks whether path is named WORKSPACE or WORKSPACE.bazel