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 2b12203
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pre_commit/languages/dotnet.py
Expand Up @@ -12,7 +12,6 @@
from pre_commit.languages import helpers
from pre_commit.prefix import Prefix
from pre_commit.util import clean_path_on_failure
from pre_commit.util import rmtree

ENVIRONMENT_DIR = 'dotnetenv'
BIN_DIR = 'bin'
Expand Down Expand Up @@ -76,9 +75,14 @@ def install_environment(
),
)

# Cleanup build output
for d in ('bin', 'obj', build_dir):
rmtree(prefix.path(d))
# Clean the git dir, ignoring the environment dir
helpers.run_setup_cmd(
prefix,
(
'git', 'clean', '-ffxd',
'-e', f'{ENVIRONMENT_DIR}-*',
),
)


def run_hook(
Expand Down

0 comments on commit 2b12203

Please sign in to comment.