FEAT: Configurable readme committer

This commit is contained in:
BradBot_1 2023-02-23 23:06:14 +00:00
parent e23fcdde1a
commit b1facb1cba

View file

@ -84,12 +84,12 @@ export async function changeCommitAuthors(recipient: Recipient, out: string = __
}
export async function insertToReadme(projectName: string, projectLink: string, out: string = __dirname): Promise<void> {
const git = Git(out).addConfig('user.email', 'BradBot_1@outlook.com').addConfig('user.name', 'BradBot1');
const git = Git(out).addConfig('user.email', process.env['README_EMAIL']||"donotreply@bb1.fun").addConfig('user.name', process.env['README_NAME']||"GiteaForwarder");
var data: string = `> This was cloned from [${projectName}](${projectLink})\n`;
if (existsSync(out + "README.md")) data = data + readFileSync(out + "README.md").toString();
writeFileSync(out + "README.md", data);
await git.add("README.md")
await git.commit("Modify README.md", "README.md", {
"--author": '"BradBot1 <BradBot_1@outlook.com>"'
"--author": `"${process.env['README_NAME']||"GiteaForwarder"} <${process.env['README_EMAIL']||"donotreply@bb1.fun"}>"`
});
}