-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathmanifest-version-updater.js
More file actions
19 lines (16 loc) · 759 Bytes
/
manifest-version-updater.js
File metadata and controls
19 lines (16 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const stringifyPackage = require("stringify-package");
const repository = "gambit07/fxmaster";
const githubURL = "https://github.com";
const githubRawURL = "https://raw.githubusercontent.com";
module.exports.readVersion = function (contents) {
return JSON.parse(contents).version;
};
module.exports.writeVersion = function (contents, version) {
const json = JSON.parse(contents);
json.license = `${githubRawURL}/${repository}/v${version}/LICENSE.md`;
json.readme = `${githubRawURL}/${repository}/v${version}/README.md`;
json.changelog = `${githubURL}/${repository}/releases/tag/v${version}`;
json.version = version;
json.download = `${githubURL}/${repository}/releases/download/v${version}/module.zip`;
return stringifyPackage(json, 4);
};