Documentation ¶
Overview ¶
Package path contains path and environment utilities for Glide.
This includes tools to find and manipulate Go path variables, as well as tools for copying from one path to another.
Index ¶
- Constants
- Variables
- func Basepath() string
- func CopyDir(source string, dest string) error
- func CopyFile(source string, dest string) error
- func Glide() (string, error)
- func GlideWD(dir string) (string, error)
- func Gopath() string
- func Gopaths() []string
- func HasLock(basepath string) bool
- func Home() string
- func IsDirectoryEmpty(dir string) (bool, error)
- func IsLink(fi os.FileInfo) bool
- func SetHome(h string)
- func StripBasepath(p string) string
- func StripVcs() error
- func StripVendor() error
- func Vendor() (string, error)
Constants ¶
const DefaultGlideFile = "glide.yaml"
DefaultGlideFile is the default name for the glide.yaml file.
const LockFile = "glide.lock"
LockFile is the default name for the lock file.
Variables ¶
var GlideFile = DefaultGlideFile
GlideFile is the name of the Glide file.
Setting this is not concurrency safe. For consistency, it should really only be set once, at startup, or not at all.
var VendorDir = "vendor"
VendorDir is the name of the directory that holds vendored dependencies.
As of Go 1.5, this is always vendor.
Functions ¶
func Basepath ¶
func Basepath() string
Basepath returns the current working directory.
If there is an error getting the working directory, this returns ".", which should function in cases where the directory is unlinked... Then again, maybe not.
func CopyDir ¶
CopyDir copies an entire source directory to the dest directory.
This is akin to `cp -a src/* dest/`
We copy the directory here rather than jumping out to a shell so we can support multiple operating systems.
func CopyFile ¶
CopyFile copies a source file to a destination.
It follows symbolic links and retains modes.
func GlideWD ¶
GlideWD finds the working directory of the glide.yaml file, starting at dir.
If the glide file is not found in the current directory, it recurses up a directory.
func Gopath ¶
func Gopath() string
Gopath gets GOPATH from environment and return the most relevant path.
A GOPATH can contain a colon-separated list of paths. This retrieves the GOPATH and returns only the FIRST ("most relevant") path.
This should be used carefully. If, for example, you are looking for a package, you may be better off using Gopaths.
func Gopaths ¶
func Gopaths() []string
Gopaths retrieves the Gopath as a list when there is more than one path listed in the Gopath.
func Home ¶
func Home() string
Home returns the Glide home directory ($GLIDE_HOME or ~/.glide, typically).
This normalizes to an absolute path, and passes through os.ExpandEnv.
func IsDirectoryEmpty ¶
IsDirectoryEmpty checks if a directory is empty.
func StripBasepath ¶
StripBasepath removes the base directory from a passed in path.
func StripVcs ¶
func StripVcs() error
StripVcs removes VCS metadata (.git, .hg, .bzr, .svn) from the vendor/ directory.
func StripVendor ¶
func StripVendor() error
StripVendor removes nested vendor and Godeps/_workspace/ directories.
Types ¶
This section is empty.