IsEnvEnabled checks if the devbox environment is enabled. This allows us to differentiate between global and individual project shells.
()
| 190 | // This allows us to differentiate between global and |
| 191 | // individual project shells. |
| 192 | func (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 | |
| 199 | func (d *Devbox) SkipInitHookEnvName() string { |
| 200 | return "__DEVBOX_SKIP_INIT_HOOK_" + d.ProjectDirHash() |
no test coverage detected