MCPcopy Index your code
hub / github.com/jetify-com/devbox / IsEnvEnabled

Method IsEnvEnabled

internal/devbox/envvars.go:192–197  ·  view source on GitHub ↗

IsEnvEnabled checks if the devbox environment is enabled. This allows us to differentiate between global and individual project shells.

()

Source from the content-addressed store, hash-verified

190// This allows us to differentiate between global and
191// individual project shells.
192func (d *Devbox) IsEnvEnabled() bool {
193 fakeEnv := map[string]string{}
194 // the Stack is initialized in the fakeEnv, from the state in the real os.Environ
195 pathStack := envpath.Stack(fakeEnv, envir.PairsToMap(os.Environ()))
196 return pathStack.Has(d.ProjectDirHash())
197}
198
199func (d *Devbox) SkipInitHookEnvName() string {
200 return "__DEVBOX_SKIP_INIT_HOOK_" + d.ProjectDirHash()

Callers 3

ensureStateIsUpToDateMethod · 0.95
RunScriptMethod · 0.95
ensureGlobalEnvEnabledFunction · 0.80

Calls 4

ProjectDirHashMethod · 0.95
StackFunction · 0.92
PairsToMapFunction · 0.92
HasMethod · 0.80

Tested by

no test coverage detected