Last active
August 29, 2015 14:07
-
-
Save nbyst/3ca4237c0f81c37e7810 to your computer and use it in GitHub Desktop.
ローカルプロジェクトでpull,merge,rebase,checkoutなどをした時に自動的にplay ecするスクリプト
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 | |
# 第一引数にプロジェクトのルートディレクトリをいれてください | |
# 相対パスでOKです | |
project_root_dir=$1 | |
play_ec_hookscript=$project_root_dir/.git/hooks/play-eclipsify.sh | |
cat <<_EOT_ >$play_ec_hookscript | |
#!/bin/sh | |
play ec | |
_EOT_ | |
chmod +x $play_ec_hookscript | |
for hooktype in post-merge post-checkout | |
do | |
script="$project_root_dir/.git/hooks/$hooktype" | |
ln -sf ./play-eclipsify.sh $script | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使い方
~/git以下にgitリポジトリをおいている場合
curl -o /tmp/setup-play-ec-hook.sh https://gist.githubusercontent.com/nbyst/3ca4237c0f81c37e7810/raw/2b46737e636aa50f5c81ceb3ec9650c5d42068c3/setup-play-ec-hook.sh
chmod +x /tmp/setup-play-ec-hook.sh
cd ~/<ローカルリポジトリがあるディレクトリ>
wget 'https://gist.github.com/3ca4237c0f81c37e7810.git'
for dir in
ls
do
[ -e $dir/conf/application.conf ] && /tmp/setup-play-ec-hook.sh
done