I am writing a post-commit hook that publishes certain files to a webserver if they are changed.
I want to make it clear to the client / user what happens after he commited.
Thats why I added echo commands returning information to the client.
I read this post : SVN post-commit hook sending a message back to client which says that post commit hooks can only return information if I use exit 1.
This works great but it confuses clients because this message appears:
Warning: post-commit hook failed (exit code 1) with output:
Is there a way to circumvent this output?
If it helps, my script so far:
echo "Everything OK. Checking if publishing dir was changed." >&2
svn status /var/www/dev/test/public/projektbereich1/http | grep [AMCDG]
if [ $? -eq 0 ] ; then
echo "Dir has changed. Publishing files." >&2
cp -R /var/www/dev/test/public/projektbereich1/http /var/www/public/
else
echo "Dir has not changed. Webserver does not get updated." >&2
fi
exit 1