TypeScript/scripts/hooks/pre-commit

5 lines
199 B
Bash
Executable File

#!/bin/sh
if git diff --name-only --cached --relative | xargs --no-run-if-empty ./node_modules/.bin/dprint fmt; then
git diff --name-only --cached --relative | xargs --no-run-if-empty git add
fi