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

Method shellRCOverrides

internal/devbox/shell.go:265–279  ·  view source on GitHub ↗
(shellrc string)

Source from the content-addressed store, hash-verified

263}
264
265func (s *DevboxShell) shellRCOverrides(shellrc string) (extraEnv map[string]string, extraArgs []string) {
266 // Shells have different ways of overriding the shellrc, so we need to
267 // look at the name to know which env vars or args to set when launching the shell.
268 switch s.name {
269 case shBash:
270 extraArgs = []string{"--rcfile", shellescape.Quote(shellrc)}
271 case shZsh:
272 extraEnv = map[string]string{"ZDOTDIR": shellescape.Quote(filepath.Dir(shellrc))}
273 case shKsh, shPosix:
274 extraEnv = map[string]string{"ENV": shellescape.Quote(shellrc)}
275 case shFish:
276 extraArgs = []string{"-C", ". " + shellrc}
277 }
278 return extraEnv, extraArgs
279}
280
281func (s *DevboxShell) writeDevboxShellrc() (path string, err error) {
282 // We need a temp dir (as opposed to a temp file) because zsh uses

Callers 1

RunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected