mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Handling multiple outputs from dotnet pack
This commit is contained in:
parent
26a3e6f9ff
commit
7569f3393c
1 changed files with 12 additions and 15 deletions
|
|
@ -59,22 +59,19 @@ def install_environment(
|
||||||
|
|
||||||
# Determine tool from the packaged file <tool_name>.<version>.nupkg
|
# Determine tool from the packaged file <tool_name>.<version>.nupkg
|
||||||
build_outputs = os.listdir(os.path.join(prefix.prefix_dir, build_dir))
|
build_outputs = os.listdir(os.path.join(prefix.prefix_dir, build_dir))
|
||||||
if len(build_outputs) != 1:
|
for output in build_outputs:
|
||||||
raise NotImplementedError(
|
tool_name = output.split('.')[0]
|
||||||
f"Can't handle multiple build outputs. Got {build_outputs}",
|
|
||||||
)
|
|
||||||
tool_name = build_outputs[0].split('.')[0]
|
|
||||||
|
|
||||||
# Install to bin dir
|
# Install to bin dir
|
||||||
helpers.run_setup_cmd(
|
helpers.run_setup_cmd(
|
||||||
prefix,
|
prefix,
|
||||||
(
|
(
|
||||||
'dotnet', 'tool', 'install',
|
'dotnet', 'tool', 'install',
|
||||||
'--tool-path', os.path.join(envdir, BIN_DIR),
|
'--tool-path', os.path.join(envdir, BIN_DIR),
|
||||||
'--add-source', build_dir,
|
'--add-source', build_dir,
|
||||||
tool_name,
|
tool_name,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Clean the git dir, ignoring the environment dir
|
# Clean the git dir, ignoring the environment dir
|
||||||
clean_cmd = ('git', 'clean', '-ffxd', '-e', f'{ENVIRONMENT_DIR}-*')
|
clean_cmd = ('git', 'clean', '-ffxd', '-e', f'{ENVIRONMENT_DIR}-*')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue