Skip to content

Commit c570bee

Browse files
committed
also match on v prefix in version string
1 parent 9f688ea commit c570bee

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/lib/utils/versioning.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
* @returns An object with major, minor, patch as numbers, and optional commits as a number, or null if parsing fails.
99
*/
1010
function parseFirmwareVersion(versionString: string): { major: number; minor: number; patch: number; commits?: number } | null {
11+
// Remove 'v' prefix if present (e.g., "v0.8.3" -> "0.8.3")
12+
const cleanVersion = versionString.replace(/^v/, '');
13+
1114
// Regex to match "X.Y.Z" or "X.Y.Z-dev.C" where X, Y, Z, C are digits
1215
const regex = /(\d+)\.(\d+)\.(\d+)(?:-dev\.(\d+))?$/;
13-
const match = versionString.match(regex);
16+
const match = cleanVersion.match(regex);
1417

1518
if (match) {
1619
const parsed = {

0 commit comments

Comments
 (0)