【发布时间】:2012-09-24 14:00:11
【问题描述】:
我正在编写一个 post-commit 钩子,如果它们被更改,它会将某些文件发布到网络服务器。
我想向客户/用户说明他提交后会发生什么。
这就是为什么我添加了返回信息给客户端的 echo 命令。
我读过这篇文章:SVN post-commit hook sending a message back to client,它说 post commit hooks 只能在我使用 exit 1 时返回信息。
这很好用,但它让客户感到困惑,因为出现了这条消息:
Warning: post-commit hook failed (exit code 1) with output:
有没有办法绕过这个输出?
如果有帮助,我的脚本到目前为止:
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
【问题讨论】:
标签: bash svn post-commit