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

Function _make_local_repo

pre_commit/store.py:48–56  ·  view source on GitHub ↗
(directory: str)

Source from the content-addressed store, hash-verified

46
47
48def _make_local_repo(directory: str) -> None:
49 for resource in _LOCAL_RESOURCES:
50 resource_dirname, resource_basename = os.path.split(resource)
51 contents = resource_text(f'empty_template_{resource_basename}')
52 target_dir = os.path.join(directory, resource_dirname)
53 target_file = os.path.join(target_dir, resource_basename)
54 os.makedirs(target_dir, exist_ok=True)
55 with open(target_file, 'w') as f:
56 f.write(contents)
57
58
59class Store:

Calls 1

resource_textFunction · 0.90