aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2024-11-21 05:21:42 -0500
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2024-11-21 11:22:23 +0100
commitbcfdf9a356a709dd0c9e60f3800798e0f0b2bc53 (patch)
treea17b7bc5f26b0184a2004705dcbff3b70ffcebe6
parent5eab9df7b6a8a64680390b01b495975c22f4bf2d (diff)
downloadjquery-bcfdf9a356a709dd0c9e60f3800798e0f0b2bc53.tar.gz
jquery-bcfdf9a356a709dd0c9e60f3800798e0f0b2bc53.zip
Build: Fix pre release matching in compare size regex
Closes gh-5584 (cherry picked from commit 041f6e347b621227822b900a7a821d341f0c5d53)
-rw-r--r--build/tasks/lib/compareSize.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/build/tasks/lib/compareSize.js b/build/tasks/lib/compareSize.js
index 008f91151..978881cfc 100644
--- a/build/tasks/lib/compareSize.js
+++ b/build/tasks/lib/compareSize.js
@@ -5,7 +5,7 @@ import { exec as nodeExec } from "node:child_process";
import chalk from "chalk";
import isCleanWorkingDir from "./isCleanWorkingDir.js";
-const VERSION = 1;
+const VERSION = 2;
const lastRunBranch = " last run";
const gzip = promisify( zlib.gzip );
@@ -111,7 +111,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
// Remove the short SHA and .dirty from comparisons.
// The short SHA so commits can be compared against each other
// and .dirty to compare with the existing branch during development.
- const sha = /jQuery v\d+.\d+.\d+(?:-\w+)?(?:\+slim\.|\+)?([^ \.]+(?:\.dirty)?)?/.exec( contents )[ 1 ];
+ const sha = /jQuery v\d+.\d+.\d+(?:-[\w\.]+)?(?:\+slim\.|\+)?(\w+(?:\.dirty)?)?/.exec( contents )[ 1 ];
contents = contents.replace( new RegExp( sha, "g" ), "" );
const size = Buffer.byteLength( contents, "utf8" );