-
-
Save postmechanical/8584068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| ### CocoaPods git-checkout hook | |
| # | |
| # This is a hook which you can install, it will automatically | |
| # run `pod install` when you do a git pull/clone/checkout. | |
| # | |
| # The hook can be used to make CocoaPods usable with Xcode CI. | |
| # | |
| ## Installation | |
| # | |
| # This git post-checkout hook can be installed by running the | |
| # following command. Note, you will need to re-install this | |
| # everytime you update Xcode. | |
| # | |
| # $ [sudo] curl -o /Applications/Xcode.app/Contents/Developer/usr/share/git-core/templates/hooks/post-checkout https://gist.githubusercontent.com/postmechanical/8584068/raw/018ba437d85fa7e025c73525bd15961c9e42a9a5/post-checkout.sh | |
| # $ [sudo] chmod +x /Applications/Xcode.app/Contents/Developer/usr/share/git-core/templates/hooks/post-checkout | |
| # | |
| if [ -r Podfile ] ; then | |
| env -i HOME=/Library/Developer/XcodeServer PATH=$PATH pod install | |
| # Avoid the Xcode checkout error: | |
| # Your local changes to the following files would be overwritten by checkout: | |
| # Podfile.lock | |
| # Please, commit your changes or stash them before you can switch branches. | |
| # Aborting | |
| env -i HOME=/Library/Developer/XcodeServer PATH=$PATH git reset --hard | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment