mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Small cleanups
This commit is contained in:
parent
e717df0ba8
commit
18c9e061d8
17 changed files with 40 additions and 58 deletions
|
|
@ -93,18 +93,16 @@ def tmpdir():
|
|||
rmtree(tempdir)
|
||||
|
||||
|
||||
def resource_filename(filename):
|
||||
def resource_filename(*segments):
|
||||
return pkg_resources.resource_filename(
|
||||
'pre_commit',
|
||||
os.path.join('resources', filename),
|
||||
'pre_commit', os.path.join('resources', *segments),
|
||||
)
|
||||
|
||||
|
||||
def make_executable(filename):
|
||||
original_mode = os.stat(filename).st_mode
|
||||
os.chmod(
|
||||
filename,
|
||||
original_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH,
|
||||
filename, original_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue