Skip to content

Commit 6eca202

Browse files
authored
fix: when nuking then also nuke any installed git hooks (except pre-installed sample hooks) to avoid leaving stale hooks behind (#850)
1 parent a6b0c10 commit 6eca202

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,13 @@ clean: dist-clean
232232
rm -fr docs/_build/
233233

234234
# Remove code caches, or the entire virtual environment.
235-
.PHONY: nuke-caches nuke
236-
nuke-caches: clean
235+
.PHONY: nuke-git-hooks nuke-caches nuke
236+
nuke-git-hooks:
237+
find .git/hooks/ -type f ! -name '*.sample' -exec rm -fr {} +
238+
nuke-caches:
237239
find src/ -type d -name __pycache__ -exec rm -fr {} +
238240
find tests/ -type d -name __pycache__ -exec rm -fr {} +
239-
nuke: nuke-caches
241+
nuke: clean nuke-git-hooks nuke-caches
240242
if [ ! -z "${VIRTUAL_ENV}" ]; then \
241243
echo "Please deactivate the virtual environment first!" && exit 1; \
242244
fi

0 commit comments

Comments
 (0)