CocoaPods/Specs — Issue #14: git pre-commit hook to automatically pod spec lint changed podspecs
Author: floere
Created: 2011-11-16 13:16:00+00:00
State: open

To automatically check changed cocoa pods before committing, add this file:
.git/hooks/pre-commit
with the following content:
```bash
#!/bin/sh

for FILE in `git diff-index --name-status HEAD -- | cut -c3- | grep '.podspec$'` ; do
# Check the pod spec
#
if [ "pod spec lint $FILE" ]
then
echo $FILE 'fails pod spec lint. Cannot commit!'
exit 1
fi
done
exit
```
and make it executable.

Whenever you commit, it will check changed pod specs using `pod spec lint` and prevent you from committing if it fails.

Have fun, cheers!