mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
resource_filename instead of trying to remember the right invocation to pkg_resources.
This commit is contained in:
parent
c7b605fee2
commit
8fee06b53e
3 changed files with 16 additions and 21 deletions
|
|
@ -4,9 +4,10 @@ from __future__ import unicode_literals
|
|||
import io
|
||||
import os
|
||||
import os.path
|
||||
import pkg_resources
|
||||
import stat
|
||||
|
||||
from pre_commit.util import resource_filename
|
||||
|
||||
|
||||
# This is used to identify the hook file we install
|
||||
PREVIOUS_IDENTIFYING_HASHES = [
|
||||
|
|
@ -36,9 +37,7 @@ def make_executable(filename):
|
|||
|
||||
def install(runner, overwrite=False):
|
||||
"""Install the pre-commit hooks."""
|
||||
pre_commit_file = pkg_resources.resource_filename(
|
||||
'pre_commit', 'resources/pre-commit-hook',
|
||||
)
|
||||
pre_commit_file = resource_filename('pre-commit-hook')
|
||||
|
||||
# If we have an existing hook, move it to pre-commit.legacy
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue