Skip to content

Commit

Permalink
fix dotnet build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Nov 2, 2020
1 parent 3112e08 commit 8bfa650
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pre_commit/languages/dotnet.py
Expand Up @@ -76,9 +76,17 @@ def install_environment(
),
)

# Cleanup build output
for d in ('bin', 'obj', build_dir):
rmtree(prefix.path(d))
# Remove everything except for the envdir and hook config
to_keep = (
helpers.environment_dir(ENVIRONMENT_DIR, version),
'.pre-commit-hooks.yaml',
)
for f in os.listdir(prefix.prefix_dir):
path = prefix.path(f)
if os.path.isfile(path):
os.remove(path)
elif f not in to_keep:
rmtree(path)


def run_hook(
Expand Down

0 comments on commit 8bfa650

Please sign in to comment.