Skip to content

Commit fc6bd31

Browse files
committed
Allow range of versions
1 parent 75f29a6 commit fc6bd31

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

packages/powersync/bin/setup_web.dart

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,9 @@ void main(List<String> arguments) async {
6767
String sqlite3Version =
6868
"v${getPubspecVersion(packageConfigFile, sqlite3Pkg, sqlitePackageName)}";
6969

70-
//Sets the range of powersync core version that is compatible with the sqlite3 version
71-
VersionRange sqliteCoreRange = VersionRange(
72-
min: Version(0, 1, 0),
73-
max: Version(0, 1, 9),
74-
includeMin: true,
75-
includeMax: true,
76-
);
7770
List<String> tags = await getLatestTagsFromRelease(httpClient);
7871
String? matchTag = tags.firstWhereOrNull((element) =>
79-
element.contains(sqlite3Version) &&
80-
coreVersionIsInRange(element, sqliteCoreRange));
72+
element.contains(sqlite3Version) && coreVersionIsInRange(element));
8173
if (matchTag != null) {
8274
sqlite3Version = matchTag;
8375
} else {
@@ -96,7 +88,14 @@ void main(List<String> arguments) async {
9688
}
9789
}
9890

99-
bool coreVersionIsInRange(String tag, VersionRange range) {
91+
bool coreVersionIsInRange(String tag) {
92+
//Sets the range of powersync core version that is compatible with the sqlite3 version
93+
VersionRange range = VersionRange(
94+
min: Version(0, 1, 0),
95+
max: Version(0, 1, 9),
96+
includeMin: true,
97+
includeMax: true,
98+
);
10099
if (!tag.contains("-powersync")) return false;
101100
List<String> parts = tag.split('-');
102101
String powersyncPart = parts[1];

0 commit comments

Comments
 (0)