function makeReleaseCopies( Release ) {
	shell.mkdir( "-p", cdnFolder );

	Object.keys( releaseFiles ).forEach( function( key ) {
		var text,
			builtFile = releaseFiles[ key ],
			unpathedFile = key.replace( /VER/g, Release.newVersion ),
			releaseFile = cdnFolder + "/" + unpathedFile;

		if ( /\.map$/.test( releaseFile ) ) {

			// Map files need to reference the new uncompressed name;
			// assume that all files reside in the same directory.
			// "file":"jquery.min.js" ... "sources":["jquery.js"]
			text = fs.readFileSync( builtFile, "utf8" )
				.replace( /"file":"([^"]+)"/,
					"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) )
				.replace( /"sources":\["([^"]+)"\]/,
					"\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
			fs.writeFileSync( releaseFile, text );
		} else if ( builtFile !== releaseFile ) {
			shell.cp( "-f", builtFile, releaseFile );
		}
	} );
}
function makeReleaseCopies( Release ) {
	shell.mkdir( "-p", cdnFolder );

	Object.keys( releaseFiles ).forEach( function( key ) {
		var text,
			builtFile = releaseFiles[ key ],
			unpathedFile = key.replace( /VER/g, Release.newVersion ),
			releaseFile = cdnFolder + "/" + unpathedFile;

		if ( /\.map$/.test( releaseFile ) ) {

			// Map files need to reference the new uncompressed name;
			// assume that all files reside in the same directory.
			// "file":"jquery.min.js" ... "sources":["jquery.js"]
			text = fs.readFileSync( builtFile, "utf8" )
				.replace( /"file":"([^"]+)"/,
					"\"file\":\"" + unpathedFile.replace( /\.min\.map/, ".min.js\"" ) )
				.replace( /"sources":\["([^"]+)"\]/,
					"\"sources\":[\"" + unpathedFile.replace( /\.min\.map/, ".js" ) + "\"]" );
			fs.writeFileSync( releaseFile, text );
		} else if ( builtFile !== releaseFile ) {
			shell.cp( "-f", builtFile, releaseFile );
		}
	} );
}
function makeReleaseCopies ( Release ) { shell . mkdir ( "-p" , cdnFolder ) ; Object . keys ( releaseFiles ) . forEach ( function ( key ) { var text , builtFile = releaseFiles [ key ] , unpathedFile = key . replace ( / VER / g , Release . newVersion ) , releaseFile = cdnFolder + "/" + unpathedFile ; if ( / \.map$ / . test ( releaseFile ) ) { // Map files need to reference the new uncompressed name; // assume that all files reside in the same directory. // "file":"jquery.min.js" ... "sources":["jquery.js"] text = fs . readFileSync ( builtFile , "utf8" ) . replace ( / "file":"([^"]+)" / , "\"file\":\"" + unpathedFile . replace ( / \.min\.map / , ".min.js\"" ) ) . replace ( / "sources":\["([^"]+)"\] / , "\"sources\":[\"" + unpathedFile . replace ( / \.min\.map / , ".js" ) + "\"]" ) ; fs . writeFileSync ( releaseFile , text ) ; } else if ( builtFile !== releaseFile ) { shell . cp ( "-f" , builtFile , releaseFile ) ; } } ) ; }
Generates copies for the CDNs
Generates copies for the CDNs
Copies the files from the built file to the new release file