Open watanabe1115 opened 6 years ago
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# Redirect output to stderr.
exec 1>&2
IS_ERROR=0
# コミットされるファイルのうち、.csで終わるもの
for FILE in `git diff --name-only --cached | grep ".cs"`; do
# CodeFormmaterで整形
if mono CodeFormatter/Bin/CodeFormatter.exe --settings CodeFormatter/Bin/CodeFormatterSettings.xml $FILE; then
git add $FILE
else
IS_ERROR=1
fi
done
exit $IS_ERROR