Skip to content

Instantly share code, notes, and snippets.

@michaelochs
Created March 12, 2015 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelochs/76ccbb6c63455e9cb14c to your computer and use it in GitHub Desktop.
Save michaelochs/76ccbb6c63455e9cb14c to your computer and use it in GitHub Desktop.
A git post checkout hook that ensures your pods are up to date. If there are no changes in the pods environment, this script does nothing.
#!/bin/sh
diff "Podfile.lock" "Pods/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
echo 'CocoaPods needs some more clean up...'
echo 'Quit iOS simulator...'
osascript -e 'tell app "iPhone Simulator" to quit'
echo 'Quit Xcode...'
osascript -e 'tell app "Xcode" to quit'
pod install
# echo 'Clean derived data folder...'
# rm -rf ~/Library/Developer/Xcode/DerivedData/*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment