add hook for 'prettier'
This commit is contained in:
parent
dacd38c5be
commit
23a8c22b56
|
@ -17,6 +17,11 @@ read -p "Repository [$my_repo_tmp/${my_site}.git]: " my_repos
|
||||||
read -p "Deploy to [/srv/www/beta.therootcompany.com/$my_site]: " my_deploy
|
read -p "Deploy to [/srv/www/beta.therootcompany.com/$my_site]: " my_deploy
|
||||||
: ${my_deploy:="/srv/www/beta.therootcompany.com/$my_site"}
|
: ${my_deploy:="/srv/www/beta.therootcompany.com/$my_site"}
|
||||||
|
|
||||||
|
my_pretty="x"
|
||||||
|
while [ "y" != "$my_pretty" ] && [ "n" != "$my_pretty" ]; do
|
||||||
|
read -p "Reject ugly commits? [y/n]: " my_pretty
|
||||||
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
@ -27,10 +32,16 @@ sudo bash -c "cat << EOF > ${my_repo}/hooks/post-receive
|
||||||
mkdir -p '${my_deploy}'
|
mkdir -p '${my_deploy}'
|
||||||
# always deploys from the default (master) branch
|
# always deploys from the default (master) branch
|
||||||
git --work-tree='${my_deploy}' --git-dir='${my_repo}' checkout -f
|
git --work-tree='${my_deploy}' --git-dir='${my_repo}' checkout -f
|
||||||
echo Deployed branch 'master' to '${my_deploy}'
|
echo Deployed branch "'$(git rev-parse abbrev-ref HEAD)'" to '${my_deploy}'
|
||||||
EOF
|
EOF
|
||||||
"
|
"
|
||||||
sudo chmod a+x "${my_repo}/hooks/post-receive"
|
|
||||||
|
if [ "y" == "$my_pretty" ]; then
|
||||||
|
# TODO test for / install 'prettier'
|
||||||
|
sudo rsync -av hooks/update.format.full "${my_repo}/hooks/update"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo chmod -R a+x "${my_repo}/hooks/"
|
||||||
sudo chown -R ${my_user}:${my_user} "$my_repo"
|
sudo chown -R ${my_user}:${my_user} "$my_repo"
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue