Skip to content

Commit

Permalink
chore: read package.json without using require because of cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Jan 14, 2019
1 parent 82c1699 commit 5e69f0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"eslint": "5.11.0",
"eslint-config-google": "0.11.0",
"fancy-log": "1.3.3",
"fs-extra": "7.0.1",
"gulp": "4.0.0",
"gulp-babel": "8.0.0",
"gulp-bump": "3.1.3",
Expand Down
14 changes: 11 additions & 3 deletions scripts/release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* SOFTWARE.
*/

const fs = require('fs');
const gulp = require('gulp');
const git = require('gulp-git');
const bump = require('gulp-bump');
Expand Down Expand Up @@ -75,9 +76,16 @@ function prepareNextRelease() {
* @return {void}
*/
function tagRelease(done) {
const pkg = require(config.pkg);
const version = pkg.version;
git.tag(`v${version}`, `release: tag version ${version}`, done);
fs.readFile(config.pkg, 'utf-8', (err, content) => {
if (err) {
done(err);
return;
}

const pkg = JSON.parse(content);
const version = pkg.version;
git.tag(`v${version}`, `release: tag version ${version}`, done);
});
}

/**
Expand Down

0 comments on commit 5e69f0e

Please sign in to comment.