just: Use bash to perform install-hook confirmation

The `[confirm()]` tag had issues on linux with string interpolation,
switches to using a bash based read for confirmation.
This commit is contained in:
Fintan Halpenny 2026-04-15 14:54:55 +01:00
parent 1f4de60bac
commit 69ccabacdd
1 changed files with 2 additions and 1 deletions

View File

@ -148,10 +148,11 @@ verify-tool tool package_name="":
#
# Install git hooks
[group('hooks')]
[confirm("Overwrite existing hooks '" + hooks + "'?")]
install-hooks:
#!/usr/bin/env bash
set -e
read -p "Overwrite existing hooks '{{hooks}}'? [y/N] " confirm
[[ "$confirm" == "y" ]] || exit 1
for hook in {{hooks}}; do
if [ -f ".git/hooks/$hook" ]; then
rm ".git/hooks/$hook"