import { readFile } from 'fs-extra'; import { rootDir, insertContentIntoFile } from '../tool-utils'; async function getInstallMd() { return readFile(`${rootDir}/readme/install.md`, 'utf8'); } async function createDownloadButtonsHtml(readmeMd: string): Promise> { const output: Record = {}; output['windows'] = readmeMd.match(/()/)[0]; output['macOs'] = readmeMd.match(/()/)[0]; output['macOsM1'] = readmeMd.match(/()/)[0]; output['linux'] = readmeMd.match(/()/)[0]; output['android'] = readmeMd.match(/(', '', desktopButtonsHtml.join(' ')); await insertContentIntoFile(`${rootDir}/readme/download.md`, '', '', mobileButtonsHtml.join(' ')); } const main = async () => { await updateDownloadPage(); }; if (require.main === module) { // eslint-disable-next-line promise/prefer-await-to-then main().catch((error) => { console.error('Fatal error'); console.error(error); process.exit(1); }); }