feat: 添加版本检查脚本
This commit is contained in:
parent
8ebc6e1928
commit
1a35899c41
13
scripts/version_check.sh
Executable file
13
scripts/version_check.sh
Executable 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"
|
||||
Loading…
Reference in New Issue
Block a user