Skip to content

Instantly share code, notes, and snippets.

@nbyst
Last active August 29, 2015 14:07
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 nbyst/3ca4237c0f81c37e7810 to your computer and use it in GitHub Desktop.
Save nbyst/3ca4237c0f81c37e7810 to your computer and use it in GitHub Desktop.
ローカルプロジェクトでpull,merge,rebase,checkoutなどをした時に自動的にplay ecするスクリプト
#!/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
@nbyst
Copy link
Author

nbyst commented Oct 21, 2014

使い方
~/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment