Minor fixes in the config

This commit is contained in:
Pavel Djundik 2018-10-29 09:54:58 +02:00
commit e321c7eb99
2 changed files with 24 additions and 15 deletions

View file

@ -43,14 +43,19 @@ const extractedDoc = configContent
return acc;
}, []).join("\n");
const infoBlock = `<!--
const infoBlockHeader = `<!--
DO NOT EDIT THIS FILE MANUALLY.
Content for the following is generated by this script in the main repo:
https://github.com/thelounge/thelounge/blob/master/scripts/generate-config-doc.js
Last updated at ${Date()} by ${getGitUsername()}
https://github.com/thelounge/thelounge/blob/master/scripts/generate-config-doc.js`;
const infoBlockTop = `${infoBlockHeader}
Last updated at ${getPrettyDate()} (UTC) by ${getGitUsername()}
-->`;
const generatedContent = `${infoBlock}\n\n${extractedDoc}\n${infoBlock}\n`;
const infoBlockBottom = `${infoBlockHeader}
-->`;
const generatedContent = `${infoBlockTop}\n\n${extractedDoc}\n${infoBlockBottom}\n`;
writeFileSync(docPath, generatedContent);
@ -59,3 +64,7 @@ log.info(
`(${colors.bold(generatedContent.length)} characters) ` +
`were written in ${colors.green(docPath)}.`
);
function getPrettyDate() {
return (new Date()).toISOString().split(".")[0].replace("T", " ");
}