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

Function open

internal/devconfig/config.go:104–117  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

102}
103
104func open(path string) (*Config, error) {
105 // First try the happy path by assuming that path is a directory
106 // containing a devbox.json.
107 cfg, err := searchDir(path)
108 if errors.Is(err, ErrNotFound) || errors.Is(err, errNotDirectory) {
109 // Try reading path directly as a config file.
110 slog.Debug("trying config file", "path", path)
111 cfg, err = readFromFile(path)
112 if errors.Is(err, errIsDirectory) {
113 return nil, ErrNotFound
114 }
115 }
116 return cfg, err
117}
118
119// Find is like [Open] except it recursively searches up the directory tree,
120// starting in path. It returns [ErrNotFound] if path is a valid directory and

Callers 6

logToFileFunction · 0.85
setupDevboxLauncherFunction · 0.85
setupSSHConfigFunction · 0.85
OpenFunction · 0.85
FindFunction · 0.85
gen_cast.pyFile · 0.85

Calls 3

searchDirFunction · 0.85
readFromFileFunction · 0.85
IsMethod · 0.80

Tested by

no test coverage detected