我在弄自动化代码部署。现在有点不明白。当用脚本去git pull origin master 后,有可能失败,有可能成功。那么有没有办法知道成功和失败的状态。
谢谢!
为情所困2017-05-02 09:22:09
It can usually be seen. If there is an error, it will usually be fatal, and you will be prompted as to why the error occurred: there may be a conflict, etc.
PHP中文网2017-05-02 09:22:09
if [ $? == 0 ];then
echo "success"
else
echo "fail"
fi
Try the above code