Fix cargo fmt portion of pre-commit

This commit is contained in:
Tim Kuehn
2021-03-26 19:38:56 -07:00
parent c191ff5b2e
commit 3d7b0171fe

View File

@@ -94,11 +94,11 @@ for file in $(git diff --name-only --cached);
do
if [ ${file: -3} == ".rs" ]; then
diff="$diff$(cargo fmt -- --check $file)"
if [ $? != 0 ]; then
FMTRESULT=1
fi
fi
done
if grep --quiet "^[-+]" <<< "$diff"; then
FMTRESULT=1
fi
if [ "${TARPC_SKIP_RUSTFMT}" == 1 ]; then
printf "${SKIPPED}\n"$?