MCPcopy Index your code
hub / github.com/dagger/container-use / FileWrite

Method FileWrite

environment/filesystem.go:42–49  ·  view source on GitHub ↗
(ctx context.Context, explanation, targetFile, contents string)

Source from the content-addressed store, hash-verified

40}
41
42func (env *Environment) FileWrite(ctx context.Context, explanation, targetFile, contents string) error {
43 err := env.apply(ctx, env.container().WithNewFile(targetFile, contents))
44 if err != nil {
45 return fmt.Errorf("failed applying file write, skipping git propagation: %w", err)
46 }
47 env.Notes.Add("Write %s", targetFile)
48 return nil
49}
50
51func (env *Environment) FileEdit(ctx context.Context, explanation, targetFile, search, replace, matchID string) error {
52 contents, err := env.container().File(targetFile).Contents(ctx)

Callers 1

Calls 3

applyMethod · 0.95
containerMethod · 0.95
AddMethod · 0.80

Tested by

no test coverage detected