MCPcopy Index your code
hub / github.com/dagger/dagger / replace

Method replace

sdk/java/runtime/main.go:441–455  ·  view source on GitHub ↗
(
	ctx context.Context,
	dir *dagger.Directory,
	path string,
	changes ...repl,
)

Source from the content-addressed store, hash-verified

439}
440
441func (m *JavaSdk) replace(
442 ctx context.Context,
443 dir *dagger.Directory,
444 path string,
445 changes ...repl,
446) (string, error) {
447 content, err := dir.File(path).Contents(ctx)
448 if err != nil {
449 return "", err
450 }
451 for _, change := range changes {
452 content = strings.ReplaceAll(content, change.oldString, change.newString)
453 }
454 return content, nil
455}
456
457func (m *JavaSdk) mavenCommand(args ...string) []string {
458 if m.MavenErrors {

Callers 15

addTemplateMethod · 0.95
with_strMethod · 0.80
add_childMethod · 0.80
selectMethod · 0.80
select_multipleMethod · 0.80
root_selectMethod · 0.80
select_idMethod · 0.80
_exception_attributesFunction · 0.80
bind_parentMethod · 0.80
to_pascal_caseFunction · 0.80
to_camel_caseFunction · 0.80

Calls 2

FileMethod · 0.65
ContentsMethod · 0.45

Tested by 3

querySanitizerFunction · 0.64