Created
July 4, 2015 21:28
-
-
Save 5470x3/8f487979dced025e056f to your computer and use it in GitHub Desktop.
post-updateをコピーして宛先をsedで置換するだけのシェルスクリプト
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/bash | |
REPOS=("accounts" "search" "core" "lightbox" "tool") | |
REPOS_PATH="/home/git/repositories/dev/" | |
REF="${REPOS_PATH}refference.git/hooks/post-update" | |
for REPO in ${REPOS[@]} | |
do | |
echo $REPO | |
cp ${REF} ${REPOS_PATH}${REPO}.git/hooks/ | |
sed -i -e "s/refference/${REPO}.git/g" ${REPOS_PATH}${REPO}.git/hooks/post-update | |
# 1回目コピーしたらpiyo.git.gitになってしまったので | |
# sed -i -e "s/.git.git/.git/g" ${REPOS_PATH}${REPO}.git/hooks/post-update | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment