Skip to content

Commit

Permalink
package.json bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PRO-2684 committed Aug 1, 2024
1 parent eeb44fa commit e647dbe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "node ./scripts/test.js",
"prepare": "",
"postversion": "node ./scripts/postversion.js"
"version": "node ./scripts/update_version.js; git add purlfy.js"
},
"repository": {
"type": "git",
Expand Down
24 changes: 0 additions & 24 deletions scripts/post_version.js

This file was deleted.

14 changes: 14 additions & 0 deletions scripts/update_version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Modify the version number at `purlfy.js` file:
// `return "0.3.5";`
// to the new version number.
// And then `git add purlfy.js`.

const fs = require('fs');
const package = require('../package.json');
const purlfyPath = "./purlfy.js";

const version = package.version;
const data = fs.readFileSync(purlfyPath, 'utf8');
const result = data.replace(/return "\d+\.\d+\.\d+";/, `return "${version}";`);
fs.writeFileSync(purlfyPath, result, 'utf8');
console.log(`Updated version to ${version}`);

0 comments on commit e647dbe

Please sign in to comment.