14 lines
214 B
Plaintext
14 lines
214 B
Plaintext
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
filesToFormat=$(
|
||
|
git --no-pager diff --name-status --no-color --cached | \
|
||
|
awk '$1 != "D" && $2 ~ /\.rs/ {print $2}'
|
||
|
)
|
||
|
|
||
|
for path in $filesToFormat
|
||
|
do
|
||
|
rustfmt $path
|
||
|
git add $path
|
||
|
done;
|