update: check version of snap

This commit is contained in:
msojocs 2022-04-25 19:09:41 +08:00
parent 6ca62fe4c8
commit 0014eac997

View File

@ -11,11 +11,13 @@ VERSION_DATA=(${VERSION_DATA//,/ })
TARGET_VERSION=${VERSION_DATA[0]} TARGET_VERSION=${VERSION_DATA[0]}
TARGET_VERSION_MD5=${VERSION_DATA[1]} TARGET_VERSION_MD5=${VERSION_DATA[1]}
LATEST_TAG=$(git describe --abbrev=0)
# 检查snapcraft主版本号是否正确 # 检查snapcraft主版本号是否正确
SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d{5,}" -o) SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d+-\d+" -o)
if [ "${SNAP_VERSION//\'/}" != "$TARGET_VERSION" ];then if [ "v${SNAP_VERSION//\'/}" != "$LATEST_TAG" ];then
echo "SNAP版本不匹配!!!" echo "SNAP版本不正确!!!"
echo "SNAP版本: $SNAP_VERSION != 目标版本: $TARGET_VERSION" echo "SNAP版本: v${SNAP_VERSION//\'/} != 最新TAG: $LATEST_TAG"
exit 1 exit 1
fi fi