Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Allow ¶
func Allow(cmd oscommands.ICmdObjBuilder, envrcPath string) error
Allow runs `direnv allow <envrcPath>` to approve a .envrc file so the next Load can read it.
Types ¶
type LoadResult ¶
type LoadResult struct {
// Message is whatever direnv printed to stderr — useful to log
// (success: "direnv: loading .envrc"; error: the error text).
Message string
// Err is non-nil when direnv exited non-zero or its stdout could
// not be parsed.
Err error
// Blocked is true when the target .envrc exists but hasn't been
// approved with `direnv allow` yet. EnvrcPath then holds the path
// direnv said was blocked, suitable for passing to Allow.
Blocked bool
EnvrcPath string
}
LoadResult bundles everything callers might want to know about a direnv invocation. The env-var delta has already been applied to the process by the time Load returns.
func Load ¶
func Load(cmd oscommands.ICmdObjBuilder) LoadResult
Load runs `direnv export json` for the current working directory and applies the resulting env-var delta to the current process. If direnv isn't on PATH, it's a no-op — users who don't use direnv pay nothing, and users who do need no config to opt in.
Click to show internal directories.
Click to hide internal directories.