Merge pull request #1678 from rkm/dotnet-fix-cleanup

fix dotnet build cleanup
This commit is contained in:
Anthony Sottile 2020-11-03 10:33:15 -08:00 committed by GitHub
commit 392a1fe16d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,6 @@ from pre_commit.hook import Hook
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'
@ -76,9 +75,9 @@ 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
clean_cmd = ('git', 'clean', '-ffxd', '-e', f'{ENVIRONMENT_DIR}-*')
helpers.run_setup_cmd(prefix, clean_cmd)
def run_hook(