first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
'use strict';
const marked = require("marked");
const fs = require('fs');
const { VERSION } = process.env;
if (!VERSION) {
console.error('missing VERSION env var');
process.exit(1);
return;
}
(async () => {
try {
const changelogText = fs.readFileSync('readme.txt', 'utf-8');
const data = marked.lexer(changelogText);
const headerIndex = data.findIndex((section) => section.type === 'paragraph' && section.text.startsWith(`= ${VERSION}`));
if (headerIndex === -1) {
console.error(`Failed to find version: ${VERSION} in readme.txt file`);
process.exit(1);
return;
}
const versionLog = data[headerIndex + 1].raw;
fs.writeFileSync('temp-changelog-from-readme.txt', versionLog);
} catch (err) {
process.exit(1);
}
})();