2021-12-29 13:15:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
filesToFormat=$(
|
|
|
|
git --no-pager diff --name-status --no-color --cached | \
|
2022-01-12 11:02:49 +00:00
|
|
|
awk '$1 != "D" && $2 ~ /\.rs/ {print $NF}'
|
2021-12-29 13:15:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
for path in $filesToFormat
|
|
|
|
do
|
2021-12-31 15:17:55 +00:00
|
|
|
rustfmt --edition 2021 $path
|
2021-12-29 13:15:19 +00:00
|
|
|
git add $path
|
|
|
|
done;
|