diff --git a/build/release.js b/build/release.js index c872bcf8..872d4449 100644 --- a/build/release.js +++ b/build/release.js @@ -1,3 +1,6 @@ +var fs = require("fs"); +var path = require("path"); + module.exports = function(Release) { Release.define({ @@ -11,7 +14,17 @@ Release.define({ generateArtifacts: function(callback) { Release.exec("grunt"); + + // Update version references in README.md + var readmePath = path.join(Release.dir.repo, "README.md"); + var readme = fs.readFileSync(readmePath, "utf8").replace( + /pep\/\d+\.\d+\.\d+\/pep\.js/g, + "pep/" + Release.newVersion + "/pep.js" + ); + fs.writeFileSync(readmePath, readme); + callback([ + "README.md", "dist/pep.js", "dist/pep.min.js" ]);