Further unify the scripts

This commit is contained in:
be5invis 2023-11-23 21:47:31 -08:00
parent 5eda6c18ef
commit d51f80f270
4 changed files with 10 additions and 16 deletions

View file

@ -4,7 +4,7 @@ import url from "url";
import semver from "semver";
import { Output } from "./shared/index.mjs";
import { MdCol } from "./md-format-tools.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
@ -27,7 +27,7 @@ async function GenerateChangeList(argv, out) {
}
}
export default (async function main(argv) {
const out = new Output();
const out = new MdCol();
await GenerateChangeList(argv, out);
await fs.promises.writeFile(argv.outputPath, out.buffer);
await fs.promises.writeFile(argv.outputPath, out.data);
});

View file

@ -4,13 +4,15 @@ import url from "url";
import SemVer from "semver";
import { Output } from "./shared/index.mjs";
import { MdCol } from "./md-format-tools.mjs";
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const ChangeFileDir = path.join(__dirname, "../../changes");
///////////////////////////////////////////////////////////////////////////////////////////////////
// CHANGE LIST
async function GenerateChangeList(argv, out) {
const changeFiles = await fs.promises.readdir(ChangeFileDir);
const fragments = new Map();
@ -34,7 +36,7 @@ async function GenerateChangeList(argv, out) {
}
}
export default (async function main(argv) {
const out = new Output();
const out = new MdCol("Release-Note");
let baseUrl = `https://github.com/be5invis/Iosevka/blob/v${argv.version}/doc`;
await GenerateChangeList(argv, out);
out.log(
@ -47,5 +49,5 @@ export default (async function main(argv) {
`</td></tr>` +
`</table>`
);
await fs.promises.writeFile(argv.outputPath, out.buffer);
await fs.promises.writeFile(argv.outputPath, out.data);
});

View file

@ -1,8 +0,0 @@
export class Output {
constructor() {
this.buffer = "";
}
log(...s) {
this.buffer += s.join("") + "\n";
}
}

View file

@ -1055,7 +1055,7 @@ const ReleaseNotesFile = file.make(
await t.need(Version, UtilScripts, de(ARCHIVE_DIR));
const [changeFiles] = await t.need(ChangeFileList());
await t.need(changeFiles.map(fu));
await node("utility/generate-release-note/release-note.mjs", {
await node("utility/amend-readme/generate-release-note.mjs", {
version,
outputPath: out.full
});
@ -1070,7 +1070,7 @@ const ChangeLogMd = file(`CHANGELOG.md`, async (t, out) => {
await t.need(UtilScripts, de(ARCHIVE_DIR));
const [changeFiles] = await t.need(ChangeFileList());
await t.need(changeFiles.map(fu));
await node("utility/generate-release-note/change-log.mjs", { version, outputPath: out.full });
await node("utility/amend-readme/generate-change-log.mjs", { version, outputPath: out.full });
});
const ChangeFileList = oracle.make(
() => `release:change-file-list`,