From b1facb1cbafb2aa4c8bfaa036b015ac2ef7e5463 Mon Sep 17 00:00:00 2001 From: BradBot_1 Date: Thu, 23 Feb 2023 23:06:14 +0000 Subject: [PATCH] FEAT: Configurable readme committer --- src/Git/GitManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Git/GitManager.ts b/src/Git/GitManager.ts index 395b375..f434dad 100644 --- a/src/Git/GitManager.ts +++ b/src/Git/GitManager.ts @@ -84,12 +84,12 @@ export async function changeCommitAuthors(recipient: Recipient, out: string = __ } export async function insertToReadme(projectName: string, projectLink: string, out: string = __dirname): Promise { - 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 "' + "--author": `"${process.env['README_NAME']||"GiteaForwarder"} <${process.env['README_EMAIL']||"donotreply@bb1.fun"}>"` }); } \ No newline at end of file