From 1a35899c4152faf06273ab4f4e4f35c5e8f03b11 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 20 Feb 2026 00:05:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/version_check.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/version_check.sh diff --git a/scripts/version_check.sh b/scripts/version_check.sh new file mode 100755 index 0000000..b324b6b --- /dev/null +++ b/scripts/version_check.sh @@ -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"