MCPcopy Index your code
hub / github.com/google/adk-python / copy_dir_contents

Function copy_dir_contents

src/google/adk/cli/fast_api.py:213–227  ·  view source on GitHub ↗
(source_dir: Path, dest_dir: Path)

Source from the content-addressed store, hash-verified

211 return tmp_agent_root
212
213 def copy_dir_contents(source_dir: Path, dest_dir: Path) -> None:
214 dest_dir.mkdir(parents=True, exist_ok=True)
215 for source_path in source_dir.iterdir():
216 if source_path.name == "tmp":
217 continue
218
219 dest_path = dest_dir / source_path.name
220 if source_path.is_dir():
221 if dest_path.exists() and dest_path.is_file():
222 dest_path.unlink()
223 shutil.copytree(source_path, dest_path, dirs_exist_ok=True)
224 elif source_path.is_file():
225 if dest_path.exists() and dest_path.is_dir():
226 shutil.rmtree(dest_path)
227 shutil.copy2(source_path, dest_path)
228
229 def cleanup_tmp(app_name: str) -> bool:
230 try:

Callers 4

ensure_tmp_existsMethod · 0.85
builder_buildMethod · 0.85
ensure_tmp_existsFunction · 0.85
builder_buildFunction · 0.85

Calls 2

unlinkMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected