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

Function _write_legacy_hook

tests/commands/install_uninstall_test.py:329–333  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

327
328
329def _write_legacy_hook(path):
330 os.makedirs(os.path.join(path, '.git/hooks'), exist_ok=True)
331 with open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f:
332 f.write('#!/usr/bin/env bash\necho legacy hook\n')
333 make_executable(f.name)
334
335
336def test_install_existing_hooks_no_overwrite(tempdir_factory, store):

Calls 1

make_executableFunction · 0.90

Tested by

no test coverage detected