Remove leftover pre-commit Git hooks in script/setup (#195844)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Erik Montnemery
2026-12-01 20:19:25 +01:00
committed by GitHub
co-authored by Martin Hjelmare
parent 911126026f
commit 8c163ad0e1
+10
View File
@@ -31,6 +31,16 @@ fi
script/bootstrap
# Remove hooks installed by pre-commit before it was replaced by prek, so prek
# doesn't keep them as legacy hooks and run in migration mode
hooks_dir="$(git rev-parse --git-path hooks)"
for hook in "$hooks_dir/pre-commit" "$hooks_dir/pre-commit.legacy"; do
if grep -qs "File generated by pre-commit" "$hook"; then
echo "Removing $hook installed by pre-commit."
rm "$hook"
fi
done
prek install
hass --script ensure_config -c config