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

Method writeTo

internal/shellgen/flake_plan.go:299–317  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

297}
298
299func (g *glibcPatchFlake) writeTo(dir string) error {
300 wantCUDA := slices.ContainsFunc(g.Dependencies, func(dep string) bool {
301 return strings.Contains(dep, "cudaPackages")
302 })
303 if wantCUDA {
304 err := g.copySystemCUDALib(dir)
305 if err != nil {
306 slog.Debug("error copying system libcuda.so to flake", "dir", dir)
307 }
308 }
309 changed, err := writeFromTemplate(dir, g, "glibc-patch.nix", "flake.nix")
310 if err != nil {
311 return err
312 }
313 if changed {
314 _ = os.Remove(filepath.Join(dir, "flake.lock"))
315 }
316 return nil
317}
318
319func (g *glibcPatchFlake) LogValue() slog.Value {
320 inputs := make([]slog.Attr, 0, 2+len(g.Inputs))

Callers 1

GenerateForPrintEnvFunction · 0.80

Calls 3

copySystemCUDALibMethod · 0.95
writeFromTemplateFunction · 0.85
RemoveMethod · 0.45

Tested by

no test coverage detected