Tidy ensures that the lockfile has the set of packages corresponding to the devbox.json config. It gets rid of older packages that are no longer needed.
()
| 204 | // Tidy ensures that the lockfile has the set of packages corresponding to the devbox.json config. |
| 205 | // It gets rid of older packages that are no longer needed. |
| 206 | func (f *File) Tidy() { |
| 207 | keep := f.devboxProject.AllPackageNamesIncludingRemovedTriggerPackages() |
| 208 | keep = append(keep, f.devboxProject.Stdenv().String()) |
| 209 | maps.DeleteFunc(f.Packages, func(key string, pkg *Package) bool { |
| 210 | return !slices.Contains(keep, key) |
| 211 | }) |
| 212 | } |
| 213 | |
| 214 | // IsUpToDateAndInstalled returns true if the lockfile is up to date and the |
| 215 | // local hashes match, which generally indicates all packages are correctly |
no test coverage detected