MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / get_env_patch

Function get_env_patch

pre_commit/languages/rust.py:51–60  ·  view source on GitHub ↗
(target_dir: str, version: str)

Source from the content-addressed store, hash-verified

49
50
51def get_env_patch(target_dir: str, version: str) -> PatchesT:
52 return (
53 ('PATH', (os.path.join(target_dir, 'bin'), os.pathsep, Var('PATH'))),
54 # Only set RUSTUP_TOOLCHAIN if we don't want use the system's default
55 # toolchain
56 *(
57 (('RUSTUP_TOOLCHAIN', _rust_toolchain(version)),)
58 if version != 'system' else ()
59 ),
60 )
61
62
63@contextlib.contextmanager

Callers 1

in_envFunction · 0.70

Calls 2

VarClass · 0.90
_rust_toolchainFunction · 0.85

Tested by

no test coverage detected