Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Build: Update version references in the README during releases
Browse files Browse the repository at this point in the history
Fixes gh-249
Closes gh-306
  • Loading branch information
scottgonzalez committed Jul 18, 2016
1 parent a9d1b71 commit 35d17d8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build/release.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var fs = require("fs");
var path = require("path");

module.exports = function(Release) {

Release.define({
Expand All @@ -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"
]);
Expand Down

0 comments on commit 35d17d8

Please sign in to comment.