hooks/cargo-lock-updater

13 lines
289 B
Plaintext
Raw Normal View History

2024-08-23 09:40:05 +10:00
#!/usr/bin/env zsh
find . -type f -name 'Cargo.lock' -print0 | while IFS=$'\0' read -r -d '' file; do
(cd "$(dirname "$file")" && cargo update -wq)
git add $file
done
if [ -f "Makefile" ]; then
if [ ! -z $(grep "fmt-check:" "Makefile") ]; then
make fmt-check 2>&1 >/dev/null
fi
fi