Merge pull request #87 from mousavian/master
[git-ftp.git] / post-receive
blobd2a161a18ade51c9f91fe547bfd460421e8ecb01
1 #!/bin/bash
2 # You may install this post-receive hook in your remote git repository
3 # to have automatic file upload when pushing to the repository.
4 while read OLD_COMMIT NEW_COMMIT REFNAME; do
5 BRANCH=${REFNAME#refs/heads/}
7 if [[ `grep "^\[$BRANCH\]$" ftpdata` ]]; then
8 echo "Uploading $BRANCH..."
9 $(dirname $(readlink -f "$0"))/git-ftp.py -b "$BRANCH" -c "$NEW_COMMIT" || exit $?
11 done
12 true