mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Factor out bash and activate files
This commit is contained in:
parent
00a3a9a09b
commit
a5b56bd9e3
13 changed files with 149 additions and 189 deletions
|
|
@ -45,13 +45,7 @@ class PrefixedCommandRunner(object):
|
|||
def exists(self, *parts):
|
||||
return os.path.exists(self.path(*parts))
|
||||
|
||||
@classmethod
|
||||
def from_command_runner(cls, command_runner, path_end):
|
||||
"""Constructs a new command runner from an existing one by appending
|
||||
`path_end` to the command runner's prefix directory.
|
||||
"""
|
||||
return cls(
|
||||
command_runner.path(path_end),
|
||||
popen=command_runner.__popen,
|
||||
makedirs=command_runner.__makedirs,
|
||||
def star(self, end):
|
||||
return tuple(
|
||||
path for path in os.listdir(self.prefix_dir) if path.endswith(end)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue