Browse Source

Check .po files before committing.

pull/333/head
Joachim Bauch 9 years ago
parent
commit
659ecb4337
  1. 18
      src/hooks/pre-commit.hook

18
src/hooks/pre-commit.hook

@ -73,3 +73,21 @@ echo "========================================================================== @@ -73,3 +73,21 @@ echo "==========================================================================
exit 1
fi
fi
for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.po$"` ; do
echo "Checking ${file}"
nf=`git checkout-index --temp ${file} | cut -f 1`
./src/i18n/helpers/polint.py "${nf}"
r=$?
rm "${nf}"
if [ $r != 0 ] ; then
echo "================================================================================================="
echo " Format error in: $file "
echo " "
echo " Please fix before committing. Don't forget to run git add before trying to commit again. "
echo " "
echo "================================================================================================="
exit 1
fi
done

Loading…
Cancel
Save