docs: use URLs for LICENSE and README and update them during version bumps

This commit is contained in:
Johannes Loher 2022-02-08 21:46:12 +01:00
parent 793beea213
commit fff74d555d

View file

@ -7,8 +7,14 @@ import semver from "semver";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
const getDownloadURL = (version) => `https://git.f3l.de/dungeonslayers/ds4/-/releases/${version}/downloads/ds4.zip`;
const getChangelogURL = (version) => `https://git.f3l.de/dungeonslayers/ds4/-/releases/${version}`;
const repository = "dungeonslayers/ds4";
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) => `${gitlabURL}/${repository}/-/releases/${version}/downloads/ds4.zip`;
const manifestPath = "./system.json";
/**
@ -61,9 +67,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 });
}