aboutsummaryrefslogtreecommitdiffstats
path: root/build/release
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2023-03-08 10:15:23 -0500
committerGitHub <noreply@github.com>2023-03-08 15:15:23 +0000
commit25ee194cc5043096d1db289fb24f5954936f667a (patch)
treef35dbda7684d47b051f306e34e9f93818c8b9864 /build/release
parentdbe09e39673fa77f7753c30fea783fc061d1230f (diff)
downloadjquery-25ee194cc5043096d1db289fb24f5954936f667a.tar.gz
jquery-25ee194cc5043096d1db289fb24f5954936f667a.zip
Release: add support for md5 sums in windows
Close gh-5218
Diffstat (limited to 'build/release')
-rw-r--r--build/release/cdn.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/build/release/cdn.js b/build/release/cdn.js
index 3d96d0179..0cbea4a7a 100644
--- a/build/release/cdn.js
+++ b/build/release/cdn.js
@@ -4,6 +4,7 @@ var
fs = require( "fs" ),
shell = require( "shelljs" ),
path = require( "path" ),
+ os = require( "os" ),
cdnFolder = "dist/cdn",
@@ -68,12 +69,13 @@ function makeArchives( Release, callback ) {
console.log( "Creating production archive for " + cdn );
- var sum,
+ var i, sum, result,
archiver = require( "archiver" )( "zip" ),
md5file = cdnFolder + "/" + cdn + "-md5.txt",
output = fs.createWriteStream(
cdnFolder + "/" + cdn + "-jquery-" + Release.newVersion + ".zip"
),
+ rmd5 = /[a-f0-9]{32}/,
rver = /VER/;
output.on( "close", callback );
@@ -89,7 +91,18 @@ function makeArchives( Release, callback ) {
item.replace( rver, Release.newVersion );
} );
- sum = Release.exec( "md5 -r " + files.join( " " ), "Error retrieving md5sum" );
+ if ( os.platform() === "win32" ) {
+ sum = [];
+ for ( i = 0; i < files.length; i++ ) {
+ result = Release.exec(
+ "certutil -hashfile " + files[ i ] + " MD5", "Error retrieving md5sum"
+ );
+ sum.push( rmd5.exec( result )[ 0 ] + " " + files[ i ] );
+ }
+ sum = sum.join( "\n" );
+ } else {
+ sum = Release.exec( "md5 -r " + files.join( " " ), "Error retrieving md5sum" );
+ }
fs.writeFileSync( md5file, sum );
files.push( md5file );