1 2 3 4 5 6 7 8
#!/bin/sh if git diff --name-only --cached | grep '^server/'; then cd server cargo fmt || exit 1 cargo clippy -- -D warnings || exit 1 cd .. fi git add -u