mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Environments are now installed to version-specific locations. Resolves #229
This commit is contained in:
parent
154d918ff1
commit
45d4a195ef
9 changed files with 71 additions and 44 deletions
|
|
@ -3,6 +3,13 @@ from __future__ import unicode_literals
|
|||
import pipes
|
||||
|
||||
|
||||
def environment_dir(ENVIRONMENT_DIR, language_version):
|
||||
if ENVIRONMENT_DIR is None:
|
||||
return None
|
||||
else:
|
||||
return '{0}-{1}'.format(ENVIRONMENT_DIR, language_version)
|
||||
|
||||
|
||||
def file_args_to_stdin(file_args):
|
||||
return '\0'.join(list(file_args) + [''])
|
||||
|
||||
|
|
@ -19,8 +26,9 @@ def run_hook(env, hook, file_args):
|
|||
|
||||
|
||||
class Environment(object):
|
||||
def __init__(self, repo_cmd_runner):
|
||||
def __init__(self, repo_cmd_runner, language_version):
|
||||
self.repo_cmd_runner = repo_cmd_runner
|
||||
self.language_version = language_version
|
||||
|
||||
@property
|
||||
def env_prefix(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue