feat: 添加版本检查脚本

This commit is contained in:
Ubuntu 2026-02-20 00:05:12 +08:00
parent 8ebc6e1928
commit 1a35899c41

13
scripts/version_check.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# 读取 pubspec.yaml 中的 version 字段
VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: *//' | tr -d ' ')
# 检查 version 格式是否符合 x.x.x+x用正则
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+\+[0-9]+$ ]]; then
echo "错误: version 格式不符合 x.x.x+x"
exit 1
fi
# 输出格式:当前版本: x.x.x+x
echo "当前版本: $VERSION"