MCPcopy Create free account
hub / github.com/dagger/dagger / grep_dir

Method grep_dir

sdk/python/runtime/template/main.py:13–22  ·  view source on GitHub ↗

Returns lines that match a pattern in the files of the provided Directory

(self, directory_arg: dagger.Directory, pattern: str)

Source from the content-addressed store, hash-verified

11
12 @function
13 async def grep_dir(self, directory_arg: dagger.Directory, pattern: str) -> str:
14 """Returns lines that match a pattern in the files of the provided Directory"""
15 return await (
16 dag.container()
17 .from_("alpine:latest")
18 .with_mounted_directory("/mnt", directory_arg)
19 .with_workdir("/mnt")
20 .with_exec(["grep", "-R", pattern, "."])
21 .stdout()
22 )

Callers

nothing calls this directly

Calls 6

with_workdirMethod · 0.80
from_Method · 0.80
stdoutMethod · 0.45
with_execMethod · 0.45
containerMethod · 0.45

Tested by

no test coverage detected