From 898cf0b21dc343c0df98e9d60eae311f9b097b96 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Mon, 2 Dec 2024 14:37:15 +0800 Subject: [PATCH] fix version consistency checking for hotfix. --- scripts/check_version.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/check_version.dart b/scripts/check_version.dart index 718a558b..92d778e3 100644 --- a/scripts/check_version.dart +++ b/scripts/check_version.dart @@ -5,7 +5,19 @@ import 'package:yaml/yaml.dart'; void main() { File pubspec = File('pubspec.yaml'); var doc = loadYaml(pubspec.readAsStringSync()); - var version = doc['version']; + var versionStr = doc['version']; + + RegExpMatch? match = RegExp(r'(\d+\.\d+\.\d+)').firstMatch(versionStr); + + var version = match![0]; + + if (version == null) { + // ignore: avoid_print + print('Could not find version in pubspec.yaml'); + exit(1); + } + + print('Checking version $version'); var files = [ 'ios/livekit_client.podspec',