我有一个用于git post-receive hook的脚本
read oldrev newrev refname
set -e
echo DELETE
rm -rf *
echo DELETED
...
运行脚本时,输出看起来像这样
remote: DELETE
但是脚本停止了。但是,当我删除“ set -e”或删除“ read”时,它将起作用。
read oldrev newrev refname
echo DELETE
rm -rf *
echo DELETED
...
结果
remote: DELETE
remote: DELETED
或
set -e
echo DELETE
rm -rf *
echo DELETED
结果
remote: DELETE
remote: DELETED
我不明白为什么它不起作用。
编辑:添加第二和第三个代码示例的输出