diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-19 07:00:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-19 07:00:25 +0000 |
commit | a5907b904f568d3249b7629ea9ff3b932f723ce3 (patch) | |
tree | b82c427c125ea5fcf9d1e2fb48e4a529fc932fba /pre_commit/languages/dotnet.py | |
parent | Adding upstream version 2.18.1. (diff) | |
download | pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.tar.xz pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.zip |
Adding upstream version 2.19.0.upstream/2.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/languages/dotnet.py')
-rw-r--r-- | pre_commit/languages/dotnet.py | 29 |
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}-*') |