Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa80234

Browse files
rkmasottile
authored andcommitted
fix dotnet build cleanup
1 parent 3fa9d3d commit aa80234

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

pre_commit/languages/dotnet.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from pre_commit.languages import helpers
1313
from pre_commit.prefix import Prefix
1414
from pre_commit.util import clean_path_on_failure
15-
from pre_commit.util import rmtree
1615

1716
ENVIRONMENT_DIR = 'dotnetenv'
1817
BIN_DIR = 'bin'
@@ -76,9 +75,9 @@ def install_environment(
7675
),
7776
)
7877

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

8382

8483
def run_hook(

0 commit comments

Comments
 (0)