Skip to content

Commit

Permalink
Auto bump version in README on release
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrini committed Nov 19, 2023
1 parent e2f5131 commit cfa9d38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"babel": "npm run babel-umd -s && npm run babel-esm -s",
"postbuild": "npm run test -s",
"prepublishOnly": "npm run build -s",
"version": "node scripts/version.js",
"patch": "npm version patch && npm publish",
"minor": "npm version minor && npm publish",
"major": "npm version major && npm publish",
Expand Down
10 changes: 10 additions & 0 deletions scripts/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Replace version in README.md
const { version: NEW_VERSION } = require('../package.json');
const fs = require('fs');
const { execSync } = require('child_process');

const readme = fs.readFileSync('README.md', 'utf8');
const newReadme = readme.replace(/vue-async-computed@\d+\.\d+\.\d+/g, `vue-async-computed@${NEW_VERSION}`);
fs.writeFileSync('README.md', newReadme, 'utf8');

execSync('git add README.md');

0 comments on commit cfa9d38

Please sign in to comment.