[envs] don't show enabled meson hooks as detected hooks

This commit is contained in:
odrling 2024-04-10 10:07:43 +02:00
parent 16ac82622d
commit 21d50e89f8
No known key found for this signature in database
GPG key ID: EC907F69A27A90C5
2 changed files with 8 additions and 3 deletions

View file

@ -115,8 +115,14 @@ odr-display-hooks() {
git config --get-regexp odrhooks\. 2>/dev/null
}
odr-add-detected-hooks() {
for name in "${@}"; do
[ "$(git config odrhooks.${name})" != 1 ] && DETECTED_HOOKS+=("${name}")
done
}
odr-detect-hooks() {
[ -f "meson.build" ] && DETECTED_HOOKS+=(muon muonfmt)
[ -f "meson.build" ] && odr-add-detected-hooks muon muonfmt
}
odr_previous_dir=''

View file

@ -12,8 +12,7 @@
local hooks=()
for hook in ${possible_hooks[@]}; do
[ "$(git config odrhooks.$hook)" != 1 ] &&
grep $hook pyproject.toml &>/dev/null && hooks+=($hook)
grep $hook pyproject.toml &>/dev/null && odr-add-detected-hooks $hook
done
DETECTED_HOOKS+="${hooks[@]}"