direnv

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 6 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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