mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Release: edit dist README version on release
Fixes gh-3574
This commit is contained in:
parent
a31111bdb4
commit
f8faf1489e
@ -49,6 +49,15 @@ module.exports = function( Release, files, complete ) {
|
|||||||
}, null, 2 );
|
}, null, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace the version in the README
|
||||||
|
* @param {string} readme
|
||||||
|
*/
|
||||||
|
function editReadme( readme ) {
|
||||||
|
var rprev = new RegExp( Release.prevVersion, "g" );
|
||||||
|
return readme.replace( rprev, Release.newVersion );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy necessary files over to the dist repo
|
* Copy necessary files over to the dist repo
|
||||||
*/
|
*/
|
||||||
@ -57,6 +66,7 @@ module.exports = function( Release, files, complete ) {
|
|||||||
// Copy dist files
|
// Copy dist files
|
||||||
var distFolder = Release.dir.dist + "/dist",
|
var distFolder = Release.dir.dist + "/dist",
|
||||||
externalFolder = Release.dir.dist + "/external",
|
externalFolder = Release.dir.dist + "/external",
|
||||||
|
readme = fs.readFileSync( Release.dir.dist + "/README.md", "utf8" ),
|
||||||
rmIgnore = files
|
rmIgnore = files
|
||||||
.concat( [
|
.concat( [
|
||||||
"README.md",
|
"README.md",
|
||||||
@ -93,8 +103,17 @@ module.exports = function( Release, files, complete ) {
|
|||||||
// Write generated bower file
|
// Write generated bower file
|
||||||
fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );
|
fs.writeFileSync( Release.dir.dist + "/bower.json", generateBower() );
|
||||||
|
|
||||||
console.log( "Adding files to dist..." );
|
fs.writeFileSync( Release.dir.dist + "/README.md", editReadme( readme ) );
|
||||||
|
|
||||||
|
console.log( "Files ready to add." );
|
||||||
|
console.log( "Edit the dist README.md to include the latest blog post link." );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add, commit, and tag the dist files
|
||||||
|
*/
|
||||||
|
function commit() {
|
||||||
|
console.log( "Adding files to dist..." );
|
||||||
Release.exec( "git add -A", "Error adding files." );
|
Release.exec( "git add -A", "Error adding files." );
|
||||||
Release.exec(
|
Release.exec(
|
||||||
"git commit -m \"Release " + Release.newVersion + "\"",
|
"git commit -m \"Release " + Release.newVersion + "\"",
|
||||||
@ -130,6 +149,10 @@ module.exports = function( Release, files, complete ) {
|
|||||||
copy,
|
copy,
|
||||||
Release.confirmReview,
|
Release.confirmReview,
|
||||||
|
|
||||||
|
Release._section( "Add, commit, and tag files in distribution repo" ),
|
||||||
|
commit,
|
||||||
|
Release.confirmReview,
|
||||||
|
|
||||||
Release._section( "Pushing files to distribution repo" ),
|
Release._section( "Pushing files to distribution repo" ),
|
||||||
push
|
push
|
||||||
], complete );
|
], complete );
|
||||||
|
Loading…
Reference in New Issue
Block a user