Skip to content

Commit bcfdf9a

Browse files
timmywilmgol
authored andcommitted
Build: Fix pre release matching in compare size regex
Closes jquerygh-5584 (cherry picked from commit 041f6e3)
1 parent 5eab9df commit bcfdf9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/tasks/lib/compareSize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { exec as nodeExec } from "node:child_process";
55
import chalk from "chalk";
66
import isCleanWorkingDir from "./isCleanWorkingDir.js";
77

8-
const VERSION = 1;
8+
const VERSION = 2;
99
const lastRunBranch = " last run";
1010

1111
const gzip = promisify( zlib.gzip );
@@ -111,7 +111,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
111111
// Remove the short SHA and .dirty from comparisons.
112112
// The short SHA so commits can be compared against each other
113113
// and .dirty to compare with the existing branch during development.
114-
const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+slim\.|\+)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ];
114+
const sha = /jQuery v\d+.\d+.\d+(?:-[\w\.]+)?(?:\+slim\.|\+)?(\w+(?:\.dirty)?)?/.exec( contents )[ 1 ];
115115
contents = contents.replace( new RegExp( sha, "g" ), "" );
116116

117117
const size = Buffer.byteLength( contents, "utf8" );

0 commit comments

Comments
 (0)