mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 16:44:42 +04:00
simplify environment_dir
This commit is contained in:
parent
10f835c501
commit
05c8911363
17 changed files with 77 additions and 103 deletions
|
|
@ -31,8 +31,7 @@ def get_env_patch(venv: str) -> PatchesT:
|
|||
|
||||
@contextlib.contextmanager
|
||||
def in_env(prefix: Prefix) -> Generator[None, None, None]:
|
||||
directory = helpers.environment_dir(ENVIRONMENT_DIR, C.DEFAULT)
|
||||
envdir = prefix.path(directory)
|
||||
envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, C.DEFAULT)
|
||||
with envcontext(get_env_patch(envdir)):
|
||||
yield
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ def install_environment(
|
|||
) -> None:
|
||||
helpers.assert_version_default('dart', version)
|
||||
|
||||
envdir = prefix.path(helpers.environment_dir(ENVIRONMENT_DIR, version))
|
||||
envdir = helpers.environment_dir(prefix, ENVIRONMENT_DIR, version)
|
||||
bin_dir = os.path.join(envdir, 'bin')
|
||||
|
||||
def _install_dir(prefix_p: Prefix, pub_cache: str) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue