mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-24 17:59:23 -06:00
Handle when the hooks directory is not there on install. Resolves #234.
This commit is contained in:
@@ -48,6 +48,9 @@ def install(runner, overwrite=False, hooks=False, hook_type='pre-commit'):
|
||||
hook_path = runner.get_hook_path(hook_type)
|
||||
legacy_path = hook_path + '.legacy'
|
||||
|
||||
if not os.path.exists(os.path.dirname(hook_path)):
|
||||
os.makedirs(os.path.dirname(hook_path))
|
||||
|
||||
# If we have an existing hook, move it to pre-commit.legacy
|
||||
if (
|
||||
os.path.exists(hook_path) and
|
||||
|
||||
Reference in New Issue
Block a user