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

Function GetFile

internal/lock/lockfile.go:37–56  ·  view source on GitHub ↗
(project devboxProject)

Source from the content-addressed store, hash-verified

35}
36
37func GetFile(project devboxProject) (*File, error) {
38 lockFile := &File{
39 devboxProject: project,
40
41 LockFileVersion: lockFileVersion,
42 Packages: map[string]*Package{},
43 }
44 err := cuecfg.ParseFile(lockFilePath(project.ProjectDir()), lockFile)
45 if errors.Is(err, fs.ErrNotExist) {
46 return lockFile, nil
47 }
48 if err != nil {
49 return nil, err
50 }
51
52 // If the lockfile has legacy StorePath fields, we need to convert them to the new format
53 ensurePackagesHaveOutputs(lockFile.Packages)
54
55 return lockFile, nil
56}
57
58func (f *File) Add(pkgs ...string) error {
59 for _, p := range pkgs {

Callers 4

OpenFunction · 0.92
isDirtyMethod · 0.85

Calls 5

ParseFileFunction · 0.92
lockFilePathFunction · 0.85
IsMethod · 0.80
ProjectDirMethod · 0.65