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

Method newShell

internal/devbox/shell.go:75–89  ·  view source on GitHub ↗

newShell initializes the DevboxShell struct so it can be used to start a shell environment for the devbox project.

(envOpts devopt.EnvOptions, opts ...ShellOption)

Source from the content-addressed store, hash-verified

73// newShell initializes the DevboxShell struct so it can be used to start a shell environment
74// for the devbox project.
75func (d *Devbox) newShell(envOpts devopt.EnvOptions, opts ...ShellOption) (*DevboxShell, error) {
76 shPath, err := d.shellPath(envOpts)
77 if err != nil {
78 return nil, err
79 }
80 sh := initShellBinaryFields(shPath)
81 sh.devbox = d
82
83 for _, opt := range opts {
84 opt(sh)
85 }
86
87 slog.Debug("detected user shell", "shell", sh.binPath, "initrc", sh.userShellrcPath)
88 return sh, nil
89}
90
91// shellPath returns the path to a shell binary, or error if none found.
92func (d *Devbox) shellPath(envOpts devopt.EnvOptions) (path string, err error) {

Callers 1

ShellMethod · 0.95

Calls 2

shellPathMethod · 0.95
initShellBinaryFieldsFunction · 0.85

Tested by

no test coverage detected