简单的 shell 脚本问题。在 BB 中设置管道,我要移植的工作之一是通过一些 grunt 命令增加凉亭版本。我把它分解成单独的工作,这样它就不会自动运行,因为它会碰撞包,并提交回 repo。所以我想做的是当任务开始时,运行 git log 命令,检查最后的提交消息,如果它与预定义的消息匹配,然后退出。否则继续。如何检查最新的 git commit 消息并运行 if else check in bash?
#! /bin/bash
git log -1
if git log -1 === "pre-defined message";
then
echo "already pushed and bumped exiting"
exit 1
else
echo "not bumped -- continuing job"
./setup-git.sh
fi