summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages/dotnet.py
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/languages/dotnet.py')
-rw-r--r--pre_commit/languages/dotnet.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/pre_commit/languages/dotnet.py b/pre_commit/languages/dotnet.py
index a16e7f0..3983c6f 100644
--- a/pre_commit/languages/dotnet.py
+++ b/pre_commit/languages/dotnet.py
@@ -18,7 +18,7 @@ ENVIRONMENT_DIR = 'dotnetenv'
BIN_DIR = 'bin'
get_default_version = helpers.basic_get_default_version
-healthy = helpers.basic_healthy
+health_check = helpers.basic_health_check
def get_env_patch(venv: str) -> PatchesT:
@@ -59,22 +59,19 @@ def install_environment(
# Determine tool from the packaged file <tool_name>.<version>.nupkg
build_outputs = os.listdir(os.path.join(prefix.prefix_dir, build_dir))
- if len(build_outputs) != 1:
- raise NotImplementedError(
- f"Can't handle multiple build outputs. Got {build_outputs}",
+ for output in build_outputs:
+ tool_name = output.split('.')[0]
+
+ # Install to bin dir
+ helpers.run_setup_cmd(
+ prefix,
+ (
+ 'dotnet', 'tool', 'install',
+ '--tool-path', os.path.join(envdir, BIN_DIR),
+ '--add-source', build_dir,
+ tool_name,
+ ),
)
- tool_name = build_outputs[0].split('.')[0]
-
- # Install to bin dir
- helpers.run_setup_cmd(
- prefix,
- (
- 'dotnet', 'tool', 'install',
- '--tool-path', os.path.join(envdir, BIN_DIR),
- '--add-source', build_dir,
- tool_name,
- ),
- )
# Clean the git dir, ignoring the environment dir
clean_cmd = ('git', 'clean', '-ffxd', '-e', f'{ENVIRONMENT_DIR}-*')