Fix formatting check.

* shasum suffixes the checksum with '- filename' so pipe in the text instead.
* rustfmt prefixes the formatting with 'Using rustfmt config file filename' so pipe in the text instead.
This commit is contained in:
Tim Kuehn
2016-02-25 00:13:58 -08:00
parent 4c1d15f8ea
commit 3543b34f2b

View File

@@ -92,8 +92,10 @@ FMTRESULT=0
for file in $(git diff --name-only --cached);
do
if [ ${file: -3} == ".rs" ]; then
HASH=$(shasum $file)
NEW_HASH=$(rustfmt --write-mode=display $file | shasum)
HASH=$(shasum < $file)
NEW_HASH=$(rustfmt --write-mode=display < $file | shasum)
echo $HASH
echo $NEW_HASH
if [ "${HASH}" != "${NEW_HASH}" ]; then
FMTRESULT=1
fi