Created
November 12, 2014 06:42
-
-
Save to4iki/270e454d5fece0202cb9 to your computer and use it in GitHub Desktop.
以下の設定を.git/hooks/以下のpost-checkoutファイルに書いてchmod +x post-checkoutしておけばブランチ切り替えごとにPodfileの更新があれば自動的にpod installするようになる。
This file contains 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/sh | |
# parse this format | |
# x3de1b0 HEAD@{0}: checkout: moving from xxxx to yyyyy | |
BEFORE_BRANCH=`git reflog | head -1 | cut -f 6 -d ' '` | |
AFTER_BRANCH=`git reflog | head -1 | cut -f 8 -d ' '` | |
DIFF=`git diff ${BEFORE_BRANCH} ${AFTER_BRANCH} --name-only | grep Podfile` | |
if [ -n "${DIFF}" ]; then | |
bundle exec pod install # pod install | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment