From f6d94914655b8c7b032a12be3a6a68930750c1b0 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Tue, 8 Feb 2022 21:36:26 +0100 Subject: [PATCH] docs: use URLs for README and LICENSE and update them when bumping the version --- tools/bump-version.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/bump-version.mjs b/tools/bump-version.mjs index b832d3d..cd475a2 100644 --- a/tools/bump-version.mjs +++ b/tools/bump-version.mjs @@ -7,9 +7,14 @@ import semver from 'semver'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; +const repository = 'ghost/darkness-dependent-vision'; +const gitlabURL = 'https://git.f3l.de'; + +const getLicenseURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/LICENSE.md`; +const getReadmeURL = (version) => `${gitlabURL}/${repository}/-/raw/${version}/README.md`; +const getChangelogURL = (version) => `${gitlabURL}/${repository}/-/releases/${version}`; const getDownloadURL = (version) => - `https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/${version}/downloads/darkness-dependent-vision.zip`; -const getChangelogURL = (version) => `https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/${version}`; + `${gitlabURL}/${repository}/-/releases/${version}/downloads/darkness-dependent-vision.zip`; const manifestPath = 'module.json'; @@ -63,9 +68,11 @@ function bumpVersion(release) { console.log(`Bumping version number to '${targetVersion}'`); packageJson.version = targetVersion; fs.writeJSONSync('package.json', packageJson, { spaces: 4 }); + manifest.license = getLicenseURL(targetVersion); + manifest.readme = getReadmeURL(targetVersion); + manifest.changelog = getChangelogURL(targetVersion); manifest.version = targetVersion; manifest.download = getDownloadURL(targetVersion); - manifest.changelog = getChangelogURL(targetVersion); fs.writeJSONSync(manifestPath, manifest, { spaces: 4 }); }