cargo-lock-updater initial commit
This commit is contained in:
commit
ae31892358
6
.pre-commit-hooks.yaml
Normal file
6
.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
- id: cargo-lock
|
||||||
|
name: Fix Cargo.lock
|
||||||
|
description: Updates Cargo.lock
|
||||||
|
entry: cargo-lock-updater
|
||||||
|
language: script
|
||||||
|
types: [text]
|
12
cargo-lock-updater
Executable file
12
cargo-lock-updater
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/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
|
Loading…
Reference in a new issue