mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-05 15:59:16 -06:00
Environments are now installed to version-specific locations. Resolves #229
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user