MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / copy_tree_to_path

Function copy_tree_to_path

testing/fixtures.py:21–36  ·  view source on GitHub ↗

Copies all of the things inside src_dir to an already existing dest_dir. This looks eerily similar to shutil.copytree, but copytree has no option for not creating dest_dir.

(src_dir, dest_dir)

Source from the content-addressed store, hash-verified

19
20
21def copy_tree_to_path(src_dir, dest_dir):
22 """Copies all of the things inside src_dir to an already existing dest_dir.
23
24 This looks eerily similar to shutil.copytree, but copytree has no option
25 for not creating dest_dir.
26 """
27 names = os.listdir(src_dir)
28
29 for name in names:
30 srcname = os.path.join(src_dir, name)
31 destname = os.path.join(dest_dir, name)
32
33 if os.path.isdir(srcname):
34 shutil.copytree(srcname, destname)
35 else:
36 shutil.copy(srcname, destname)
37
38
39def git_dir(tempdir_factory):

Callers 1

make_repoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected