Telegram Web K with changes to work inside I2P https://web.telegram.i2p/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
878 B

/*
* https://github.com/morethanwords/tweb
* Copyright (C) 2019-2021 Eduard Kuzmenko
* https://github.com/morethanwords/tweb/blob/master/LICENSE
*/
// @ts-check
const fs = require('fs');
const text = fs.readFileSync('./CHANGELOG.md').toString('utf-8');
const writeTo = `./public/changelogs/{VERSION}.md`;
3 years ago
const separator = '### ';
const splitted = text.split(separator);
splitted.forEach(text => {
3 years ago
if(!text.trim()) return;
text = separator + text;
text = text.replace(/^\*/gm, '•');
3 years ago
const splitted = text.split('\n');
for(let i = splitted.length - 1; i >= 0; --i) {
const line = splitted[i];
if(!line.trim()) {
splitted.splice(i, 1);
} else {
break;
}
}
const firstLine = splitted.shift();
const version = firstLine.split(' ')[1];
fs.writeFileSync(writeTo.replace('{VERSION}', version), splitted.join('\n') + '\n');
});